public final class OnHeapMemorySegmentWriteOutMedium extends Object implements SegmentWriteOutMedium
| Constructor and Description |
|---|
OnHeapMemorySegmentWriteOutMedium() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Closer |
getCloser()
Returns a closer of this SegmentWriteOutMedium, which is closed in this SegmentWriteOutMedium's close() method.
|
SegmentWriteOutMedium |
makeChildWriteOutMedium()
Creates a 'child' version of the
SegmentWriteOutMedium, which can be optionally closed,
independent of this SegmentWriteOutMedium but otherwise shares the same configuration. |
WriteOutBytes |
makeWriteOutBytes()
Creates a new empty
WriteOutBytes, attached to this SegmentWriteOutMedium. |
public WriteOutBytes makeWriteOutBytes()
SegmentWriteOutMediumWriteOutBytes, attached to this SegmentWriteOutMedium. When this SegmentWriteOutMedium is
closed, the returned WriteOutBytes couldn't be used anymore.makeWriteOutBytes in interface SegmentWriteOutMediumpublic SegmentWriteOutMedium makeChildWriteOutMedium()
SegmentWriteOutMediumSegmentWriteOutMedium, which can be optionally closed,
independent of this SegmentWriteOutMedium but otherwise shares the same configuration. This allows callers
using a shared SegmentWriteOutMedium but which control the complete lifecycle of the WriteOutBytes
which they require to free the backing resources when they are finished, rather than waiting until
Closeable.close() is called for this medium.
The 'child' medium will be closed when Closeable.close() is called, if not called explicitly prior to closing this
medium.makeChildWriteOutMedium in interface SegmentWriteOutMediumpublic Closer getCloser()
SegmentWriteOutMediumgetCloser in interface SegmentWriteOutMediumpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.