public class BufferInput
extends java.io.InputStream
| Constructor and Description |
|---|
BufferInput(java.io.InputStream is)
Constructor.
|
BufferInput(java.io.InputStream is,
int bs)
Initializes the file reader.
|
BufferInput(IO io)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
byte[] |
content()
Retrieves and returns the whole text and closes the stream.
|
long |
length()
Returns the input length.
|
BufferInput |
length(long l)
Sets the input length.
|
void |
mark(int m) |
boolean |
markSupported() |
protected int |
next()
Returns the next byte (see
InputStream.read(). |
int |
read()
Returns the next byte (see
InputStream.read(). |
byte[] |
readBytes()
Reads a byte array from the input stream, suffixed by a
0 byte. |
java.lang.String |
readString()
Reads a string from the input stream, suffixed by a
0 byte. |
void |
reset() |
int |
size()
Returns the number of read bytes.
|
public BufferInput(IO io) throws java.io.IOException
io - input to be readjava.io.IOException - I/O Exceptionpublic BufferInput(java.io.InputStream is)
is - input streampublic BufferInput(java.io.InputStream is,
int bs)
is - input streambs - buffer sizepublic int read()
throws java.io.IOException
InputStream.read().
-1 is returned if all bytes have been read.read in class java.io.InputStreamjava.io.IOException - I/O exceptionprotected int next()
throws java.io.IOException
InputStream.read().
-1 is returned if all bytes have been read.java.io.IOException - I/O exceptionpublic final java.lang.String readString()
throws java.io.IOException
0 byte.java.io.IOException - I/O Exceptionpublic final byte[] readBytes()
throws java.io.IOException
0 byte.java.io.IOException - I/O Exceptionpublic final void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic final int size()
public final long length()
public final BufferInput length(long l)
l - input lengthpublic final boolean markSupported()
markSupported in class java.io.InputStreampublic void mark(int m)
mark in class java.io.InputStreampublic final void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic byte[] content()
throws java.io.IOException
java.io.IOException - I/O exception