|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.basex.io.BufferInput
public class BufferInput
This class serves as a buffered wrapper for input streams.
| Constructor Summary | |
|---|---|
BufferInput(byte[] buf)
Empty constructor. |
|
BufferInput(File file)
Initializes the file reader. |
|
BufferInput(File file,
byte[] buf)
Initializes the file reader. |
|
BufferInput(InputStream is)
Initializes the file reader. |
|
BufferInput(InputStream is,
byte[] b)
Initializes the file reader. |
|
BufferInput(String file)
Initializes the file reader. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the input stream. |
void |
encoding()
Determines the file encoding. |
void |
encoding(String e)
Sets a new encoding. |
long |
length()
Length of input. |
void |
length(long l)
Sets the input length. |
int |
read()
Reads a single byte and returns it as integer. |
static void |
read(File file,
byte[] cont)
Fills the specified array with the beginning of the specified file. |
byte |
readByte()
Returns the next byte or 0 if all bytes have been read. |
int |
readChar()
Returns the next character, 0 if all bytes have been read or a negative character value -1 if the read byte is invalid. |
String |
readString()
Reads a string from the input stream. |
int |
size()
Number of read bytes. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BufferInput(String file)
throws IOException
file - the file to be read
IOException - IO Exception
public BufferInput(File file)
throws IOException
file - the file to be read
IOException - IO Exception
public BufferInput(InputStream is)
throws IOException
is - input stream
IOException - IO Exception
public BufferInput(File file,
byte[] buf)
throws IOException
file - the file to be readbuf - input buffer
IOException - IO Exception
public BufferInput(InputStream is,
byte[] b)
throws IOException
is - input streamb - input buffer
IOException - IO Exceptionpublic BufferInput(byte[] buf)
buf - buffer| Method Detail |
|---|
public static void read(File file,
byte[] cont)
throws IOException
file - the file to be readcont - byte array
IOException - IO Exceptionpublic final void encoding()
public final void encoding(String e)
throws IOException
e - encoding
IOException - IO Exception
public final int read()
throws IOException
IOException - I/O exception
public byte readByte()
throws IOException
IOException - I/O exception
public String readString()
throws IOException
IOException - IO Exception
public final int readChar()
throws IOException
IOException - I/O exception
public final void close()
throws IOException
IOException - IO Exceptionpublic final int size()
public final long length()
public final void length(long l)
l - input length
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||