OutputStream implementation based on an underlying FileChannel's memory mapped ByteBuffer.
Implementation is based on MappedByteBufferInputStream, using it as its parent instance.
An instance maybe created via its parent MappedByteBufferInputStream#getOutputStream(FileResizeOp)
or directly MappedByteBufferOutputStream(FileChannel, MapMode, CacheMode, int, FileResizeOp).
| Modifier and Type | Field and Description |
|---|---|
| private final MappedByteBufferInputStream |
| Access | Constructor and Description |
|---|---|
| pack-priv | MappedByteBufferOutputStream(final MappedByteBufferInputStream parent, final MappedByteBufferInputStream.
|
| public | MappedByteBufferOutputStream(final FileChannel
the file channel to be mapped lazily. fileChannel, final FileChannel.the map mode, default is mmode,FileChannel..the caching mode, default is cmode,MappedByteBufferInputStream..the pow2 slice size, default is sliceShift, final MappedByteBufferInputStream.MappedByteBufferInputStream#DEFAULT_SLICE_SHIFT.Creates a new instance using the given |
| Modifier and Type | Method and Description |
|---|---|
| public final synchronized void | close()
Overrides java. Implements java. |
| public final synchronized void | flush()
Overrides java. Implements java. |
| public final synchronized void | |
| public final synchronized boolean | |
| public final synchronized long | |
| public final synchronized void | notifyLengthChange(final long newTotalSize)
|
| public final synchronized long | |
| public final synchronized MappedByteBufferInputStream | |
| public final synchronized long | |
| public final synchronized void | |
| public final synchronized void | |
| public final synchronized long | |
| public final synchronized void | write(final int
the b)byte.Implements abstract java. |
| public final synchronized void | write(final byte[]
the data. b, final int the start offset in the data. off, final int the number of bytes to write. len)Overrides java. len bytes from the specified byte array
starting at offset off to this output stream.
|
| public final synchronized void | write(final ByteBuffer
the b, final int ByteBuffer source, data is read from current ByteBuffer#position()the number of bytes to write len)Perform similar to |
| public final synchronized void | write(final MappedByteBufferInputStream
the b, final long ByteBuffer source, data is read from current MappedByteBufferInputStream#position()the number of bytes to write len)Perform similar to |
| parent | back to summary |
|---|---|
| private final MappedByteBufferInputStream parent | |
| MappedByteBufferOutputStream | back to summary |
|---|---|
| pack-priv MappedByteBufferOutputStream(final MappedByteBufferInputStream parent, final MappedByteBufferInputStream. | |
| MappedByteBufferOutputStream | back to summary |
|---|---|
| public MappedByteBufferOutputStream(final FileChannel fileChannel, final FileChannel. Creates a new instance using the given
The
| |
| close | back to summary |
|---|---|
| public final synchronized void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| flush | back to summary |
|---|---|
| public final synchronized void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| flush | back to summary |
|---|---|
| public final synchronized void flush(final boolean metaData) throws IOException | |
| getSynchronous | back to summary |
|---|---|
| public final synchronized boolean getSynchronous() | |
| length | back to summary |
|---|---|
| public final synchronized long length() | |
| notifyLengthChange | back to summary |
|---|---|
| public final synchronized void notifyLengthChange(final long newTotalSize) throws IOException | |
| position | back to summary |
|---|---|
| public final synchronized long position() throws IOException | |
| position | back to summary |
|---|---|
| public final synchronized MappedByteBufferInputStream position(final long newPosition) throws IOException | |
| remaining | back to summary |
|---|---|
| public final synchronized long remaining() throws IOException | |
| setLength | back to summary |
|---|---|
| public final synchronized void setLength(final long newTotalSize) throws IOException | |
| setSynchronous | back to summary |
|---|---|
| public final synchronized void setSynchronous(final boolean s) | |
| skip | back to summary |
|---|---|
| public final synchronized long skip(final long n) throws IOException | |
| write | back to summary |
|---|---|
| public final synchronized void write(final int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public final synchronized void write(final byte[] b, final int off, final int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public final synchronized void write(final ByteBuffer b, final int len) throws IOException Perform similar to
| |
| write | back to summary |
|---|---|
| public final synchronized void write(final MappedByteBufferInputStream b, final long len) throws IOException Perform similar to
Method directly copies memory mapped
| |