|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--java.io.DataInputStream
|
+--amber.type.AmberInputStream
An extension to the standard DataInputStream. This object allows the streaming of strings > 32k characters. It also handles null strings.
DataInputStream| Fields inherited from class java.io.FilterInputStream |
in |
| Constructor Summary | |
AmberInputStream(java.io.InputStream in)
Creates a new input stream which reads data from the defined input stream. |
|
| Method Summary | |
java.lang.String |
readLongUTF()
Reads in a string that has been encoded using an extended form of that used by the readUTF function. |
static java.lang.String |
readLongUTF(java.io.DataInput in)
Reads in a string that has been encoded using an extended form of that used by the readUTF function. |
| Methods inherited from class java.io.DataInputStream |
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes |
| Methods inherited from class java.io.FilterInputStream |
available, close, mark, markSupported, read, reset, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AmberInputStream(java.io.InputStream in)
in. - The input stream to use.| Method Detail |
public final java.lang.String readLongUTF()
throws java.io.IOException
This method blocks until all the bytes are read, the end of the stream is detected, or an exception is thrown.
java.io.EOFException - if this input stream reaches the end before
reading all the bytes.java.io.IOException - if an I/O error occurs.
public static final java.lang.String readLongUTF(java.io.DataInput in)
throws java.io.IOException
This function differs in two ways:
First, the length is encoded using 4 bytes rather than 2. This allows
long strings to be encoded.
Second, the encoding of the string is preceeded by a type byte. This
allows the stream to encode null strings in a meaningful way.
For this reason THIS FUNCTION CAN RETURN A NULL FOR THE STRING.
This method blocks until all the bytes are read, the end of the stream is detected, or an exception is thrown.
in - The data input stream to read the data from.java.io.EOFException - if the input stream reaches the end
before all the bytes.java.io.IOException - if an I/O error occurs.UTFDataFormatException - if the bytes do not represent a
valid UTF-8 encoding of a Unicode string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||