jaulib v1.3.6
Jau Support Library (C++, Java, ..)
|
An OutputStream
implementation based on an underlying FileChannel
's memory mapped ByteBuffer
.
More...
Public Member Functions | |
MappedByteBufferOutputStream (final FileChannel fileChannel, final FileChannel.MapMode mmode, final CacheMode cmode, final int sliceShift, final FileResizeOp fileResizeOp) throws IOException | |
Creates a new instance using the given FileChannel . | |
final synchronized void | setSynchronous (final boolean s) |
See MappedByteBufferInputStream#setSynchronous(boolean) . | |
final synchronized boolean | getSynchronous () |
See MappedByteBufferInputStream#getSynchronous() . | |
final synchronized void | setLength (final long newTotalSize) throws IOException |
See MappedByteBufferInputStream#setLength(long) . | |
final synchronized void | notifyLengthChange (final long newTotalSize) throws IOException |
See MappedByteBufferInputStream#notifyLengthChange(long) . | |
final synchronized long | length () |
See MappedByteBufferInputStream#length() . | |
final synchronized long | remaining () throws IOException |
See MappedByteBufferInputStream#remaining() . | |
final synchronized long | position () throws IOException |
See MappedByteBufferInputStream#position() . | |
final synchronized MappedByteBufferInputStream | position (final long newPosition) throws IOException |
See MappedByteBufferInputStream#position(long) . | |
final synchronized long | skip (final long n) throws IOException |
See MappedByteBufferInputStream#skip(long) . | |
final synchronized void | flush () throws IOException |
final synchronized void | flush (final boolean metaData) throws IOException |
See MappedByteBufferInputStream#flush(boolean) . | |
final synchronized void | close () throws IOException |
final synchronized void | write (final int b) throws IOException |
final synchronized void | write (final byte b[], final int off, final int len) throws IOException |
final synchronized void | write (final ByteBuffer b, final int len) throws IOException |
Perform similar to write(byte[], int, int) with ByteBuffer instead of byte array. | |
final synchronized void | write (final MappedByteBufferInputStream b, final long len) throws IOException |
Perform similar to write(ByteBuffer, int) with MappedByteBufferInputStream instead of byte array. | |
An 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)
.
Definition at line 48 of file MappedByteBufferOutputStream.java.
org.jau.io.MappedByteBufferOutputStream.MappedByteBufferOutputStream | ( | final FileChannel | fileChannel, |
final FileChannel.MapMode | mmode, | ||
final CacheMode | cmode, | ||
final int | sliceShift, | ||
final FileResizeOp | fileResizeOp ) throws IOException |
Creates a new instance using the given FileChannel
.
The ByteBuffer
slices will be mapped lazily at first usage.
fileChannel | the file channel to be mapped lazily. |
mmode | the map mode, default is FileChannel.MapMode#READ_WRITE . |
cmode | the caching mode, default is MappedByteBufferInputStream.CacheMode#FLUSH_PRE_SOFT . |
sliceShift | the pow2 slice size, default is MappedByteBufferInputStream#DEFAULT_SLICE_SHIFT . |
fileResizeOp | MappedByteBufferInputStream.FileResizeOp as described on MappedByteBufferInputStream#setFileResizeOp(FileResizeOp) . |
IOException |
Definition at line 72 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.close | ( | ) | throws IOException |
Definition at line 155 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.flush | ( | ) | throws IOException |
Definition at line 142 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.flush | ( | final boolean | metaData | ) | throws IOException |
See MappedByteBufferInputStream#flush(boolean)
.
Definition at line 150 of file MappedByteBufferOutputStream.java.
final synchronized boolean org.jau.io.MappedByteBufferOutputStream.getSynchronous | ( | ) |
See MappedByteBufferInputStream#getSynchronous()
.
Definition at line 88 of file MappedByteBufferOutputStream.java.
final synchronized long org.jau.io.MappedByteBufferOutputStream.length | ( | ) |
See MappedByteBufferInputStream#length()
.
Definition at line 109 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.notifyLengthChange | ( | final long | newTotalSize | ) | throws IOException |
See MappedByteBufferInputStream#notifyLengthChange(long)
.
Definition at line 102 of file MappedByteBufferOutputStream.java.
final synchronized long org.jau.io.MappedByteBufferOutputStream.position | ( | ) | throws IOException |
See MappedByteBufferInputStream#position()
.
Definition at line 123 of file MappedByteBufferOutputStream.java.
final synchronized MappedByteBufferInputStream org.jau.io.MappedByteBufferOutputStream.position | ( | final long | newPosition | ) | throws IOException |
See MappedByteBufferInputStream#position(long)
.
Definition at line 130 of file MappedByteBufferOutputStream.java.
final synchronized long org.jau.io.MappedByteBufferOutputStream.remaining | ( | ) | throws IOException |
See MappedByteBufferInputStream#remaining()
.
Definition at line 116 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.setLength | ( | final long | newTotalSize | ) | throws IOException |
See MappedByteBufferInputStream#setLength(long)
.
Definition at line 95 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.setSynchronous | ( | final boolean | s | ) |
See MappedByteBufferInputStream#setSynchronous(boolean)
.
Definition at line 82 of file MappedByteBufferOutputStream.java.
final synchronized long org.jau.io.MappedByteBufferOutputStream.skip | ( | final long | n | ) | throws IOException |
See MappedByteBufferInputStream#skip(long)
.
Definition at line 137 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.write | ( | final byte | b[], |
final int | off, | ||
final int | len ) throws IOException |
Definition at line 186 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.write | ( | final ByteBuffer | b, |
final int | len ) throws IOException |
Perform similar to write(byte[], int, int)
with ByteBuffer
instead of byte array.
b | the ByteBuffer source, data is read from current ByteBuffer#position() |
len | the number of bytes to write |
IOException | if a buffer slice operation failed or stream has been closed . |
Definition at line 239 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.write | ( | final int | b | ) | throws IOException |
Definition at line 160 of file MappedByteBufferOutputStream.java.
final synchronized void org.jau.io.MappedByteBufferOutputStream.write | ( | final MappedByteBufferInputStream | b, |
final long | len ) throws IOException |
Perform similar to write(ByteBuffer, int)
with MappedByteBufferInputStream
instead of byte array.
Method directly copies memory mapped ByteBuffer
'ed data from the given input stream to this stream without extra data copy.
b | the ByteBuffer source, data is read from current MappedByteBufferInputStream#position() |
len | the number of bytes to write |
IOException | if a buffer slice operation failed or stream has been closed . |
Definition at line 308 of file MappedByteBufferOutputStream.java.