GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.Bitstream< T >.ByteStream< T > Interface Template Reference

General byte stream. More...

Inheritance diagram for com.jogamp.common.util.Bitstream< T >.ByteStream< T >:
Collaboration diagram for com.jogamp.common.util.Bitstream< T >.ByteStream< T >:

Public Member Functions

void setStream (final T stream)
 Sets the underlying stream, without close()ing the previous one. More...
 
getStream ()
 Returns the underlying stream. More...
 
void close () throws IOException
 Closing the underlying stream, implies flush(). More...
 
void flush () throws IOException
 Synchronizes all underlying output stream operations, or do nothing. More...
 
boolean canInput ()
 Return true if stream can handle input, i.e. More...
 
boolean canOutput ()
 Return true if stream can handle output, i.e. More...
 
long position ()
 Returns the byte position in the stream. More...
 
long position (long newPosition) throws UnsupportedOperationException, IllegalArgumentException
 Sets this stream's position. More...
 
long skip (final long n) throws IOException
 It is implementation dependent, whether backward skip giving a negative number is supported or not. More...
 
void mark (final int readLimit) throws UnsupportedOperationException
 Set markpos to current position, allowing the stream to be reset(). More...
 
void reset () throws UnsupportedOperationException, IllegalStateException, IOException
 Reset stream position to markpos as set via mark(int). More...
 
int read () throws UnsupportedOperationException, IOException
 Reads one byte from the stream. More...
 
int write (final byte val) throws UnsupportedOperationException, IOException
 Writes one byte, to the stream. More...
 

Detailed Description

General byte stream.

Definition at line 60 of file Bitstream.java.

Member Function Documentation

◆ canInput()

boolean com.jogamp.common.util.Bitstream< T >.ByteStream< T >.canInput ( )

Return true if stream can handle input, i.e.

read().

◆ canOutput()

boolean com.jogamp.common.util.Bitstream< T >.ByteStream< T >.canOutput ( )

Return true if stream can handle output, i.e.

write(byte)

◆ close()

void com.jogamp.common.util.Bitstream< T >.ByteStream< T >.close ( ) throws IOException

Closing the underlying stream, implies flush().

Implementation will null the stream references, hence setStream(Object) must be called before re-using instance.

Exceptions
IOException

◆ flush()

void com.jogamp.common.util.Bitstream< T >.ByteStream< T >.flush ( ) throws IOException

Synchronizes all underlying output stream operations, or do nothing.

Exceptions
IOException
Here is the caller graph for this function:

◆ getStream()

T com.jogamp.common.util.Bitstream< T >.ByteStream< T >.getStream ( )

Returns the underlying stream.

◆ mark()

void com.jogamp.common.util.Bitstream< T >.ByteStream< T >.mark ( final int  readLimit) throws UnsupportedOperationException

Set markpos to current position, allowing the stream to be reset().

Parameters
readlimitmaximum number of bytes able to read before invalidating the markpos.
Exceptions
UnsupportedOperationExceptionif not supported, i.e. if stream is not an input stream.

◆ position() [1/2]

long com.jogamp.common.util.Bitstream< T >.ByteStream< T >.position ( )

Returns the byte position in the stream.

Here is the caller graph for this function:

◆ position() [2/2]

long com.jogamp.common.util.Bitstream< T >.ByteStream< T >.position ( long  newPosition) throws UnsupportedOperationException, IllegalArgumentException

Sets this stream's position.

A set mark is cleared if > new position.

Returns Bitstream#EOS is end-of-stream is reached, otherwise the new position.

Known supporting implementation is ByteBufferStream and ByteArrayStream.

Parameters
newPositionThe new positive position.
Returns
The new set position or Bitstream#EOS if end-of-stream is reached.
Exceptions
UnsupportedOperationExceptionif not supported, i.e. ByteInputStream or ByteOutputStream
IllegalArgumentExceptionIf the newPosition is negative

◆ read()

int com.jogamp.common.util.Bitstream< T >.ByteStream< T >.read ( ) throws UnsupportedOperationException, IOException

Reads one byte from the stream.

Returns Bitstream#EOS is end-of-stream is reached, otherwise the resulting value.

Exceptions
IOException
UnsupportedOperationExceptionif not supported, i.e. if stream is not an input stream.

◆ reset()

void com.jogamp.common.util.Bitstream< T >.ByteStream< T >.reset ( ) throws UnsupportedOperationException, IllegalStateException, IOException

Reset stream position to markpos as set via mark(int).

markpos is kept, hence reset() can be called multiple times.

Exceptions
UnsupportedOperationExceptionif not supported, i.e. if stream is not an input stream.
IllegalStateExceptionif markpos has not been set via mark(int) or reset operation failed.
IOExceptionif reset operation failed.

◆ setStream()

void com.jogamp.common.util.Bitstream< T >.ByteStream< T >.setStream ( final T  stream)

Sets the underlying stream, without close()ing the previous one.

Here is the caller graph for this function:

◆ skip()

long com.jogamp.common.util.Bitstream< T >.ByteStream< T >.skip ( final long  n) throws IOException

It is implementation dependent, whether backward skip giving a negative number is supported or not.

Parameters
nnumber of bytes to skip
Returns
actual skipped bytes
Exceptions
IOException
Here is the caller graph for this function:

◆ write()

int com.jogamp.common.util.Bitstream< T >.ByteStream< T >.write ( final byte  val) throws UnsupportedOperationException, IOException

Writes one byte, to the stream.

Returns Bitstream#EOS is end-of-stream is reached, otherwise the written value.

Exceptions
IOException
UnsupportedOperationExceptionif not supported, i.e. if stream is not an output stream.

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