Marshalling API version 1.0.0.GA

org.jboss.marshalling
Interface ByteInput

All Superinterfaces:
Closeable
All Known Subinterfaces:
Unmarshaller
All Known Implementing Classes:
AbstractUnmarshaller

public interface ByteInput
extends Closeable

An input stream of bytes.


Method Summary
 int 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.
 int read()
          Reads the next byte of data from the input stream.
 int read(byte[] b)
          Read some bytes from the input stream into the given array.
 int read(byte[] b, int off, int len)
          Read some bytes from the input stream into the given array.
 long skip(long n)
          Skips over and discards up to n bytes of data from this input stream.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

read

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:
the next byte, or -1 if the end of stream has been reached
Throws:
IOException - if an error occurs

read

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 - the destination array
Returns:
the number of bytes read (possibly zero), or -1 if the end of stream has been reached
Throws:
IOException - if an error occurs

read

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 - the destination array
off - the offset into the array into which data should be read
len - the number of bytes to attempt to fill in the destination array
Returns:
the number of bytes read (possibly zero), or -1 if the end of stream has been reached
Throws:
IOException - if an error occurs

available

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:
the number of bytes
Throws:
IOException - if an error occurs

skip

long skip(long n)
          throws IOException
Skips over and discards up to n bytes of data from this input stream.

Parameters:
n - the number of bytes to attempt to skip
Returns:
the number of bytes skipped
Throws:
IOException - if an error occurs

Marshalling API version 1.0.0.GA

Copyright © 2008 JBoss, a division of Red Hat, Inc.