public class BufferInput extends InputStream
Constructor and Description |
---|
BufferInput(InputStream is)
Constructor.
|
BufferInput(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 data and closes the stream.
|
IO |
io()
Returns the IO reference or
null . |
long |
length()
Returns the input length (can be
-1 ). |
void |
mark(int m) |
boolean |
markSupported() |
int |
read()
Returns the next byte.
|
byte[] |
readBytes()
Reads a byte array from the input stream, suffixed by a
0 byte. |
String |
readString()
Reads a string from the input stream, suffixed by a
0 byte. |
void |
reset() |
int |
size()
Returns the number of read bytes.
|
available, read, read, skip
public BufferInput(IO io) throws IOException
io
- input to be readIOException
- I/O Exceptionpublic BufferInput(InputStream is)
is
- input streampublic BufferInput(InputStream is, int bs)
is
- input streambs
- buffer sizepublic IO io()
null
.public int read() throws IOException
readByte()
;
-1
is returned if all bytes have been read.read
in class InputStream
IOException
- I/O exceptionpublic final String readString() throws IOException
0
byte.IOException
- I/O Exceptionpublic final byte[] readBytes() throws IOException
0
byte.IOException
- I/O Exceptionpublic final void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public final int size()
public final long length()
-1
).public final boolean markSupported()
markSupported
in class InputStream
public final void mark(int m)
mark
in class InputStream
public final void reset() throws IOException
reset
in class InputStream
IOException
public byte[] content() throws IOException
IOException
- I/O exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.