com.upokecenter.util.IReader
com.upokecenter.util.IReader
public interface IReader extends IByteReader
A generic interface for reading bytes of data from a data source.
Methods
int Read(byte[] bytes, int offset, int length)
Reads a portion of a byte array from the data source.
Method Details
Read
int Read(byte[] bytes, int offset, int length)
Reads a portion of a byte array from the data source.
Parameters:
bytes
- A byte array which will contain the data that was read from the data source.offset
- An index starting at 0 showing where the desired portion ofbytes
begins.length
- The number of elements in the desired portion ofbytes
(but not more thanbytes
's length).
Returns:
- The number of bytes read from the data source. Can be less than
length
if the end of the stream was reached.
Throws:
NullPointerException
- Should be thrown if the parameterbytes
is null.IllegalArgumentException
- Should be thrown if eitheroffset
orlength
is less than 0 or greater thanbytes
's length, orbytes
's length minusoffset
is less thanlength
.