|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
org.walluck.io.DataInputStreamEx
A DataInputStream with a few more methods.
DataInputStream
Field Summary |
Fields inherited from class java.io.FilterInputStream |
in |
Constructor Summary | |
DataInputStreamEx(java.io.InputStream is)
Creates a new data input stream ex. |
Method Summary | |
byte[] |
readBytes(int length)
Read exactly the specified number of bytes from the stream. |
java.lang.String |
readString(int length)
Read a string of the specified length from the stream. |
java.lang.String |
readString0(short length)
Read a null-terminated string of the specified length from the stream. |
java.lang.String |
readStringL()
Read a byte length prefixed string from the stream. |
java.lang.String |
readStringLL()
Read a short length prefixed string from the stream. |
java.lang.String |
readStringNullPadded(int length,
java.lang.String charset)
Read a null-padded string of length from an input stream. |
java.lang.String |
readStringUntilNull(int length)
Read a string from an input stream until a null is reached. |
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 DataInputStreamEx(java.io.InputStream is)
is
- the underlying input streamMethod Detail |
public java.lang.String readString(int length) throws java.io.IOException
length
- the length
java.io.IOException
- if an error occurspublic java.lang.String readString0(short length) throws java.io.IOException
length
- the length
java.io.IOException
- if an error occurspublic java.lang.String readStringL() throws java.io.IOException
java.io.IOException
- if an error occurspublic java.lang.String readStringLL() throws java.io.IOException
java.io.IOException
- if an error occurspublic byte[] readBytes(int length) throws java.io.IOException
length
- the length
java.io.IOException
- if an error occurspublic java.lang.String readStringUntilNull(int length) throws java.io.IOException
length
- the maximum length that the string can be
java.io.IOException
- if an error occurspublic java.lang.String readStringNullPadded(int length, java.lang.String charset) throws java.io.IOException
length
- the maximum length that the tring can becharset
- the Java charset
java.io.IOException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |