GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.nio.ByteBufferInputStream Class Reference

An InputStream implementation based on an underlying ByteBuffer supporting mark. More...

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

Public Member Functions

 ByteBufferInputStream (final ByteBuffer buf)
 Creates a new byte-buffer input stream. More...
 
final int available ()
 
final boolean markSupported ()
 This implementation supports mark. More...
 
final synchronized void mark (final int unused)
 This implementation supports mark. More...
 
final synchronized void reset () throws IOException
 This implementation supports mark. More...
 
final long skip (final long n) throws IOException
 
final int read ()
 
final int read (final byte[] b, final int off, final int len)
 
final int read (final ByteBuffer b, final int len)
 
final ByteBuffer getBuffer ()
 

Detailed Description

An InputStream implementation based on an underlying ByteBuffer supporting mark.

May be utilized as well with a memory-mapped FileChannel using a size ≤ Integer#MAX_VALUE.
This becomes efficient with files ≥ 10 MiB, depending on the platform and whether the traditional method uses a BufferedInputStream supporting mark incl. it's buffer size.
See test case com.jogamp.common.nio.TestByteBufferInputStream.

Since
2.3.0

Definition at line 50 of file ByteBufferInputStream.java.

Constructor & Destructor Documentation

◆ ByteBufferInputStream()

com.jogamp.common.nio.ByteBufferInputStream.ByteBufferInputStream ( final ByteBuffer  buf)

Creates a new byte-buffer input stream.

Parameters
bufthe underlying byte buffer.

Definition at line 59 of file ByteBufferInputStream.java.

Member Function Documentation

◆ available()

final int com.jogamp.common.nio.ByteBufferInputStream.available ( )

Definition at line 65 of file ByteBufferInputStream.java.

◆ getBuffer()

final ByteBuffer com.jogamp.common.nio.ByteBufferInputStream.getBuffer ( )

Definition at line 185 of file ByteBufferInputStream.java.

◆ mark()

final synchronized void com.jogamp.common.nio.ByteBufferInputStream.mark ( final int  unused)

This implementation supports mark.

See also
markSupported()

Definition at line 88 of file ByteBufferInputStream.java.

◆ markSupported()

final boolean com.jogamp.common.nio.ByteBufferInputStream.markSupported ( )

This implementation supports mark.

Definition at line 76 of file ByteBufferInputStream.java.

◆ read() [1/3]

final int com.jogamp.common.nio.ByteBufferInputStream.read ( )

Definition at line 118 of file ByteBufferInputStream.java.

◆ read() [2/3]

final int com.jogamp.common.nio.ByteBufferInputStream.read ( final byte[]  b,
final int  off,
final int  len 
)

Definition at line 126 of file ByteBufferInputStream.java.

◆ read() [3/3]

final int com.jogamp.common.nio.ByteBufferInputStream.read ( final ByteBuffer  b,
final int  len 
)

Definition at line 154 of file ByteBufferInputStream.java.

◆ reset()

final synchronized void com.jogamp.common.nio.ByteBufferInputStream.reset ( ) throws IOException

This implementation supports mark.

See also
markSupported()

Definition at line 100 of file ByteBufferInputStream.java.

◆ skip()

final long com.jogamp.common.nio.ByteBufferInputStream.skip ( final long  n) throws IOException

Definition at line 108 of file ByteBufferInputStream.java.


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