java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
com.aoapps.hodgepodge.io.stream.StreamableInput
- All Implemented Interfaces:
NoClose
,Closeable
,DataInput
,AutoCloseable
Adds compressed data transfer to DataInputStream. This class is not thread safe.
- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Reads a compressed integer from the stream.static int
Reads a compressed integer from the stream.<T extends Enum<T>>
TReads anEnum
, represented by itsEnum.name()
.Reads a string of any length.<T extends Enum<T>>
TreadNullEnum
(Class<T> enumType) Reads a string of any length, supportingnull
.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.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
Constructor Details
-
StreamableInput
-
-
Method Details
-
isNoClose
public boolean isNoClose() -
readCompressedInt
Reads a compressed integer from the stream.The 31 bit pattern is as follows:
5 bit - 000SXXXX 13 bit - 001SXXXX XXXXXXXX 22 bit - 01SXXXXX XXXXXXXX XXXXXXXX 31 bit - 1SXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- Throws:
EOFException
- if the end of file is reachedIOException
-
readCompressedInt
Reads a compressed integer from the stream.The 31 bit pattern is as follows:
5 bit - 000SXXXX 13 bit - 001SXXXX XXXXXXXX 22 bit - 01SXXXXX XXXXXXXX XXXXXXXX 31 bit - 1SXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
- Throws:
EOFException
- if the end of file is reachedIOException
-
readCompressedUTF
- Throws:
EOFException
- if the end of file is reachedIOException
-
readNullUTF
- Throws:
IOException
-
readLongUTF
Reads a string of any length.- Throws:
IOException
-
readNullLongUTF
Reads a string of any length, supportingnull
.- Throws:
IOException
-
readNullByte
- Throws:
IOException
-
readNullShort
- Throws:
IOException
-
readNullInteger
- Throws:
IOException
-
readNullLong
- Throws:
IOException
-
readEnum
Reads anEnum
, represented by itsEnum.name()
.- Throws:
IOException
-
readNullEnum
- Throws:
IOException
-
readNullBoolean
- Throws:
IOException
-