Top Description Methods
org.jboss.marshalling

public Interface ByteInput

extends Closeable
Known Direct Subinterfaces
org.jboss.marshalling.Unmarshaller
Known Direct Implementers
org.jboss.marshalling.InputStreamByteInput, org.jboss.marshalling.MarshallerObjectInputStream, org.jboss.marshalling.SimpleByteInput, org.jboss.marshalling.ByteBufferInput
Imports
java.io.Closeable, .IOException

An input stream of bytes.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of bytes
available
()

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.

public int

Returns:

the next byte, or -1 if the end of stream has been reached
read
()

Reads the next byte of data from the input stream.

public int

Returns:

the number of bytes read (possibly zero), or -1 if the end of stream has been reached
read
(byte[]
the destination array
b
)

Read some bytes from the input stream into the given array.

public int

Returns:

the number of bytes read (possibly zero), or -1 if the end of stream has been reached
read
(byte[]
the destination array
b
,
int
the offset into the array into which data should be read
off
,
int
the number of bytes to attempt to fill in the destination array
len
)

Read some bytes from the input stream into the given array.

public long

Returns:

the number of bytes skipped
skip
(long
the number of bytes to attempt to skip
n
)

Skips over and discards up to n bytes of data from this input stream.

Inherited from java.io.Closeable:
close

Method Detail

availableback to summary
public int available() throws IOException

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream.

Returns:int

the number of bytes

Exceptions
IOException:
if an error occurs
readback to summary
public int read() throws IOException

Reads the next byte of data from the input stream. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

the next byte, or -1 if the end of stream has been reached

Exceptions
IOException:
if an error occurs
readback to summary
public int read(byte[] b) throws IOException

Read some bytes from the input stream into the given array. Returns the number of bytes actually read (possibly zero), or -1 if the end of stream has been reached.

Parameters
b:byte[]

the destination array

Returns:int

the number of bytes read (possibly zero), or -1 if the end of stream has been reached

Exceptions
IOException:
if an error occurs
readback to summary
public int read(byte[] b, int off, int len) throws IOException

Read some bytes from the input stream into the given array. Returns the number of bytes actually read (possibly zero), or -1 if the end of stream has been reached.

Parameters
b:byte[]

the destination array

off:int

the offset into the array into which data should be read

len:int

the number of bytes to attempt to fill in the destination array

Returns:int

the number of bytes read (possibly zero), or -1 if the end of stream has been reached

Exceptions
IOException:
if an error occurs
skipback to summary
public long skip(long n) throws IOException

Skips over and discards up to n bytes of data from this input stream. If the end of stream is reached, this method returns 0 in order to be consistent with java.io.InputStream#skip(long).

Parameters
n:long

the number of bytes to attempt to skip

Returns:long

the number of bytes skipped

Exceptions
IOException:
if an error occurs