| java.lang.Object net.sourceforge.groboutils.util.io.v1.ReadByteStream
ReadByteStream | public class ReadByteStream (Code) | | Reads a byte array from a stream until the stream is finished.
You can specify a maximum size to read, and the block read size.
author: Matt Albrecht groboclown@users.sourceforge.net since: April 13, 2001 version: $Date: 2003/05/19 20:31:47 $ |
DEFAULT_BLOCK_READ_SIZE | final public static int DEFAULT_BLOCK_READ_SIZE(Code) | | Default block read size.
|
READ_TO_END_OF_STREAM | final public static int READ_TO_END_OF_STREAM(Code) | | Read in an unlimited number of bytes. This can be very
dangerous.
|
ReadByteStream | public ReadByteStream(InputStream is, int maxReadSize, int blockReadSize)(Code) | | |
readByteStream | public byte[] readByteStream() throws IOException(Code) | | Read in the byte stream, using the current settings.
|
readByteStream | public static byte[] readByteStream(InputStream is, int maxReadSize, int blockReadSize) throws IOException(Code) | | Read in the byte stream. Does not close the stream after it has
finished reading.
Note that there is no variable checking, for performance reasons.
The user needs to verify that:
Parameters: is - the input stream, which cannot be null. Parameters: maxReadSize - the maximum number of bytes to read, whichmust be positive, and must be modulo 0 of blockReadSize.This is an "estimation", and may actually read in more than thismany bytes if it is not modulo 0 of blockReadSize, butwill always return all the bytes read. Parameters: blockReadSize - the number of bytes to read in per read command,which cannot be more than maxReadSize, and cannot beless than or equal to zero. |
setInputStream | public void setInputStream(InputStream is)(Code) | | Sets the internal input stream.
|
setSizes | public void setSizes(int maxReadSize, int blockReadSize)(Code) | | Sets the internal sizes.
|
|
|