fm.liveswitch.ByteInputStream Class Reference

An buffer of bytes that can be read sequentially. More...

Public Member Functions

 ByteInputStream (byte[] bytes)
 Initializes a new instance of the fm.liveswitch.ByteInputStream class. More...
 
 ByteInputStream (byte[] bytes, int offset)
 Initializes a new instance of the fm.liveswitch.ByteInputStream class. More...
 
int getAvailable ()
 Gets the number of available bytes for reading. More...
 
void mark ()
 Marks the current position for a later reset. More...
 
int read ()
 Reads a value from the byte array. More...
 
int read (byte[] buffer, int offset, int length)
 Reads a segment from the byte array. More...
 
void reset ()
 Resets the stream to the marked position. More...
 
int skip (int n)
 Advances the stream position by the amount specified. More...
 

Detailed Description

An buffer of bytes that can be read sequentially.

Constructor & Destructor Documentation

◆ ByteInputStream() [1/2]

fm.liveswitch.ByteInputStream.ByteInputStream ( byte[]  bytes)

Initializes a new instance of the fm.liveswitch.ByteInputStream class.

Parameters
bytesThe bytes.

◆ ByteInputStream() [2/2]

fm.liveswitch.ByteInputStream.ByteInputStream ( byte[]  bytes,
int  offset 
)

Initializes a new instance of the fm.liveswitch.ByteInputStream class.

Parameters
bytesThe bytes.
offsetThe offset.

Member Function Documentation

◆ getAvailable()

int fm.liveswitch.ByteInputStream.getAvailable ( )

Gets the number of available bytes for reading.

◆ mark()

void fm.liveswitch.ByteInputStream.mark ( )

Marks the current position for a later reset.

◆ read() [1/2]

int fm.liveswitch.ByteInputStream.read ( )

Reads a value from the byte array.

Returns
The byte, or -1 if no more bytes are available for reading.

◆ read() [2/2]

int fm.liveswitch.ByteInputStream.read ( byte[]  buffer,
int  offset,
int  length 
)

Reads a segment from the byte array.

Returns
The number of bytes read.

◆ reset()

void fm.liveswitch.ByteInputStream.reset ( )

Resets the stream to the marked position.

◆ skip()

int fm.liveswitch.ByteInputStream.skip ( int  n)

Advances the stream position by the amount specified.

Parameters
nThe number of bytes to skip.
Returns
The number of bytes skipped.