GlueGen: com.jogamp.common.nio.MappedByteBufferOutputStream Class Reference

GlueGen v2.6.0-rc-20250721 GlueGen, Native Binding Generator for Java™ (public API).

Public Member Functions | List of all members
com.jogamp.common.nio.MappedByteBufferOutputStream Class Reference

An `OutputStream` implementation based on an underlying `FileChannel`'s memory mapped `ByteBuffer`. More...

Inheritance diagram for com.jogamp.common.nio.MappedByteBufferOutputStream:
Collaboration diagram for com.jogamp.common.nio.MappedByteBufferOutputStream:

## 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`. More...
final synchronized void | setSynchronous (final boolean s)
| See `MappedByteBufferInputStream#setSynchronous(boolean)`. More...
final synchronized boolean | getSynchronous ()
| See `MappedByteBufferInputStream#getSynchronous()`. More...
final synchronized void | setLength (final long newTotalSize) throws IOException
| See `MappedByteBufferInputStream#setLength(long)`. More...
final synchronized void | notifyLengthChange (final long newTotalSize) throws IOException
| See `MappedByteBufferInputStream#notifyLengthChange(long)`. More...
final synchronized long | length ()
| See `MappedByteBufferInputStream#length()`. More...
final synchronized long | remaining () throws IOException
| See `MappedByteBufferInputStream#remaining()`. More...
final synchronized long | position () throws IOException
| See `MappedByteBufferInputStream#position()`. More...
final synchronized MappedByteBufferInputStream | position (final long newPosition) throws IOException
| See `MappedByteBufferInputStream#position(long)`. More...
final synchronized long | skip (final long n) throws IOException
| See `MappedByteBufferInputStream#skip(long)`. More...
final synchronized void | flush () throws IOException
final synchronized void | flush (final boolean metaData) throws IOException
| See `MappedByteBufferInputStream#flush(boolean)`. More...
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. More...
final synchronized void | write (final MappedByteBufferInputStream b, final long len) throws IOException
| Perform similar to `write(ByteBuffer, int)` with `MappedByteBufferInputStream` instead of byte array. More...

## Detailed Description

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)`.

Since
  2.3.0

Definition at line 50 of file MappedByteBufferOutputStream.java.

## Constructor & Destructor Documentation

## ◆ MappedByteBufferOutputStream()

com.jogamp.common.nio.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.

Parameters

  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)`.

Exceptions

  IOException |

Definition at line 74 of file MappedByteBufferOutputStream.java.

## Member Function Documentation

## ◆ close()

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.close | ( |  | ) | throws IOException

Definition at line 157 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ flush() [1/2]

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.flush | ( |  | ) | throws IOException

Definition at line 144 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ flush() [2/2]

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.flush | ( | final boolean | metaData | ) | throws IOException

See `MappedByteBufferInputStream#flush(boolean)`.

Definition at line 152 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ getSynchronous()

final synchronized boolean com.jogamp.common.nio.MappedByteBufferOutputStream.getSynchronous | ( |  | ) |

See `MappedByteBufferInputStream#getSynchronous()`.

Definition at line 90 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ length()

final synchronized long com.jogamp.common.nio.MappedByteBufferOutputStream.length | ( |  | ) |

See `MappedByteBufferInputStream#length()`.

Definition at line 111 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ notifyLengthChange()

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.notifyLengthChange | ( | final long | newTotalSize | ) | throws IOException

See `MappedByteBufferInputStream#notifyLengthChange(long)`.

Definition at line 104 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ position() [1/2]

final synchronized long com.jogamp.common.nio.MappedByteBufferOutputStream.position | ( |  | ) | throws IOException

See `MappedByteBufferInputStream#position()`.

Definition at line 125 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ position() [2/2]

final synchronized MappedByteBufferInputStream com.jogamp.common.nio.MappedByteBufferOutputStream.position | ( | final long | newPosition | ) | throws IOException

See `MappedByteBufferInputStream#position(long)`.

Definition at line 132 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ remaining()

final synchronized long com.jogamp.common.nio.MappedByteBufferOutputStream.remaining | ( |  | ) | throws IOException

See `MappedByteBufferInputStream#remaining()`.

Definition at line 118 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ setLength()

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.setLength | ( | final long | newTotalSize | ) | throws IOException

See `MappedByteBufferInputStream#setLength(long)`.

Definition at line 97 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ setSynchronous()

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.setSynchronous | ( | final boolean | s | ) |

See `MappedByteBufferInputStream#setSynchronous(boolean)`.

Definition at line 84 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ skip()

final synchronized long com.jogamp.common.nio.MappedByteBufferOutputStream.skip | ( | final long | n | ) | throws IOException

See `MappedByteBufferInputStream#skip(long)`.

Definition at line 139 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ write() [1/4]

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.write | ( | final byte | b[],
|  | final int | off,
|  | final int | len
| ) |  | throws IOException

Definition at line 188 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ write() [2/4]

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.write | ( | final ByteBuffer | b,
|  | final int | len
| ) |  | throws IOException

Perform similar to `write(byte[], int, int)` with `ByteBuffer` instead of byte array.

Parameters

  b | the `ByteBuffer` source, data is read from current `ByteBuffer#position()`
  len | the number of bytes to write

Exceptions

  IOException | if a buffer slice operation failed or stream has been `closed`.

Definition at line 241 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ write() [3/4]

final synchronized void com.jogamp.common.nio.MappedByteBufferOutputStream.write | ( | final int | b | ) | throws IOException

Definition at line 162 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

## ◆ write() [4/4]

final synchronized void com.jogamp.common.nio.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.

Parameters

  b | the `ByteBuffer` source, data is read from current `MappedByteBufferInputStream#position()`
  len | the number of bytes to write

Exceptions

  IOException | if a buffer slice operation failed or stream has been `closed`.

Definition at line 310 of file MappedByteBufferOutputStream.java.

Here is the call graph for this function:

The documentation for this class was generated from the following file:

- src/java/com/jogamp/common/nio/MappedByteBufferOutputStream.java