Package herddb.utils
Class ExtendedDataInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.DataInputStream
-
- herddb.utils.ExtendedDataInputStream
-
- All Implemented Interfaces:
Closeable,DataInput,AutoCloseable
public class ExtendedDataInputStream extends DataInputStream
Extended version of DataInputStream- Author:
- enrico.olivelli, diego.salvi
- See Also:
ExtendedDataOutputStream
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description ExtendedDataInputStream(InputStream in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEof()byte[]readArray()BytesreadBytes()intreadVInt()Reads an int stored in variable-length format.protected intreadVInt(byte first)intreadVIntNoEOFException()Same asreadVInt()but does not throw EOFException.longreadVLong()Reads a long stored in variable-length format.intreadZInt()longreadZLong()voidskipArray()voidskipBoolean()voidskipDouble()voidskipInt()voidskipLong()-
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 Detail
-
ExtendedDataInputStream
public ExtendedDataInputStream(InputStream in)
-
-
Method Detail
-
readVInt
public int readVInt() throws IOExceptionReads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are not supported.- Returns:
- Throws:
IOException
-
readVInt
protected int readVInt(byte first) throws IOException- Throws:
IOException
-
isEof
public boolean isEof()
- Returns:
- See Also:
readVIntNoEOFException()
-
readVIntNoEOFException
public int readVIntNoEOFException() throws IOExceptionSame asreadVInt()but does not throw EOFException. Since throwing exceptions is very expensive for the JVM this operation is preferred if you could hit and EOF- Returns:
- Throws:
IOException- See Also:
isEof()
-
readVLong
public long readVLong() throws IOExceptionReads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.- Returns:
- Throws:
IOException
-
readZInt
public int readZInt() throws IOException- Throws:
IOException
-
readZLong
public long readZLong() throws IOException- Throws:
IOException
-
readBytes
public Bytes readBytes() throws IOException
- Throws:
IOException
-
readArray
public byte[] readArray() throws IOException- Throws:
IOException
-
skipArray
public void skipArray() throws IOException- Throws:
IOException
-
skipInt
public void skipInt() throws IOException- Throws:
IOException
-
skipLong
public void skipLong() throws IOException- Throws:
IOException
-
skipDouble
public void skipDouble() throws IOException- Throws:
IOException
-
skipBoolean
public void skipBoolean() throws IOException- Throws:
IOException
-
-