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