juju.reattore.io
Interface ByteSource

All Superinterfaces:
Source
All Known Subinterfaces:
BulkByteSource, FileSource
All Known Implementing Classes:
ByteBufferSource, ByteSourceSink, ChannelFileSource, PushbackByteSource

public interface ByteSource
extends Source

A source that serves bytes.


Field Summary
 
Fields inherited from interface juju.reattore.io.Source
EOF
 
Method Summary
 int get()
          Gets the next byte from the stream.
 int get(byte[] into, int offset, int length)
          Bulk get operation.
 int remaining()
          Returns the number of elements remaining in the stream.
 
Methods inherited from interface juju.reattore.io.Source
dispose
 

Method Detail

get

public int get()
        throws java.io.IOException
Gets the next byte from the stream.

Returns:
The next byte, or EOF on end of stream.
Throws:
java.io.IOException - on error.

get

public int get(byte[] into,
               int offset,
               int length)
        throws java.io.IOException
Bulk get operation.

Parameters:
into - The buffer to get into.
offset - The offset in the buffer to begin writing at.
length - The maximum number of elements to read.
Returns:
The number of elements read.
Throws:
java.io.IOException - on error.

remaining

public int remaining()
              throws java.io.IOException
Returns the number of elements remaining in the stream.

Returns:
Number remaining, or a negative number if it is unknown.
Throws:
java.io.IOException - on error.


Copyright © 2002-2003 Michael Hope. All Rights Reserved.