Package io.deephaven.util.channel
Interface SeekableChannelContext
- All Superinterfaces:
AutoCloseable,SafeCloseable
Context object for reading and writing to channels created by
SeekableChannelsProvider.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()Release any resources associated with this context.ensureContext(SeekableChannelsProvider provider, SeekableChannelContext context) A pattern that allows callers to ensure a valid context has been created forprovider.
-
Field Details
-
NULL
-
-
Method Details
-
ensureContext
static SeekableChannelContext.ContextHolder ensureContext(SeekableChannelsProvider provider, SeekableChannelContext context) A pattern that allows callers to ensure a valid context has been created forprovider. In the case where the givencontextis compatible withprovider, a no-op holder around thatcontextwill be returned. Otherwise, a holder with a newSeekableChannelsProvider.makeSingleUseContext()will be returned. The returned holder should ideally be used in a try-with-resources construction.- Parameters:
provider- the providercontext- the context- Returns:
- the context holder
-
close
default void close()Release any resources associated with this context. The context should not be used afterward.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSafeCloseable
-