Package org.apache.parquet.bytes
Class LittleEndianDataInputStream
java.lang.Object
java.io.InputStream
org.apache.parquet.bytes.LittleEndianDataInputStream
- All Implemented Interfaces:
Closeable,AutoCloseable
Based on DataInputStream but little endian and without the String/char methods
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a LittleEndianDataInputStream that uses the specified underlying InputStream. -
Method Summary
Modifier and TypeMethodDescriptionintvoidclose()booleaninthashCode()voidmark(int readlimit) booleanintread()intread(byte[] b) intread(byte[] b, int off, int len) final booleanSee the general contract of thereadBooleanmethod ofDataInput.final bytereadByte()See the general contract of thereadBytemethod ofDataInput.final doubleBytes for this operation are read from the contained input stream.final floatBytes for this operation are read from the contained input stream.final voidreadFully(byte[] b) See the general contract of thereadFullymethod ofDataInput.final voidreadFully(byte[] b, int off, int len) See the general contract of thereadFullymethod ofDataInput.final intreadInt()Bytes for this operation are read from the contained input stream.final longreadLong()Bytes for this operation are read from the contained input stream.final shortBytes for this operation are read from the contained input stream.final intSee the general contract of thereadUnsignedBytemethod ofDataInput.final intBytes for this operation are read from the contained input stream.voidreset()longskip(long n) final intskipBytes(int n) See the general contract of theskipBytesmethod ofDataInput.Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
Constructor Details
-
LittleEndianDataInputStream
Creates a LittleEndianDataInputStream that uses the specified underlying InputStream.- Parameters:
in- the specified input stream
-
-
Method Details
-
readFully
See the general contract of thereadFullymethod ofDataInput.Bytes for this operation are read from the contained input stream.
- Parameters:
b- the buffer into which the data is read.- Throws:
EOFException- if this input stream reaches the end before reading all the bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readFully
See the general contract of thereadFullymethod ofDataInput.Bytes for this operation are read from the contained input stream.
- Parameters:
b- the buffer into which the data is read.off- the start offset of the data.len- the number of bytes to read.- Throws:
EOFException- if this input stream reaches the end before reading all the bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
skipBytes
See the general contract of theskipBytesmethod ofDataInput.Bytes for this operation are read from the contained input stream.
- Parameters:
n- the number of bytes to be skipped.- Returns:
- the actual number of bytes skipped.
- Throws:
IOException- if the contained input stream does not support seek, or the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.
-
read
- Specified by:
readin classInputStream- Returns:
- the next byte in the stream as an int
- Throws:
IOException- if there is an exception while reading- See Also:
-
hashCode
public int hashCode() -
read
- Overrides:
readin classInputStream- Parameters:
b- a byte array- Returns:
- the number of bytes read
- Throws:
IOException- if there was an exception while reading- See Also:
-
equals
-
read
- Overrides:
readin classInputStream- Parameters:
b- a byte arrayoff- an offset into the byte arraylen- the length to read- Returns:
- the number of bytes read
- Throws:
IOException- if there was an exception while reading- See Also:
-
skip
- Overrides:
skipin classInputStream- Parameters:
n- the number of bytes to skip- Returns:
- the number of bytes skipped
- Throws:
IOException- if there was an exception while reading- See Also:
-
available
- Overrides:
availablein classInputStream- Returns:
- the number of bytes available in the wrapped stream
- Throws:
IOException- if there was an exception while getting the number of available bytes- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException- if there was an exception while closing the underlying stream- See Also:
-
mark
public void mark(int readlimit) - Overrides:
markin classInputStream- Parameters:
readlimit- the number of bytes the mark will be valid for- See Also:
-
reset
- Overrides:
resetin classInputStream- Throws:
IOException- if there is an exception while resetting the underlying stream- See Also:
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classInputStream- Returns:
- true if mark is supported
- See Also:
-
readBoolean
See the general contract of thereadBooleanmethod ofDataInput.Bytes for this operation are read from the contained input stream.
- Returns:
- the
booleanvalue read. - Throws:
EOFException- if this input stream has reached the end.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readByte
See the general contract of thereadBytemethod ofDataInput.Bytes for this operation are read from the contained input stream.
- Returns:
- the next byte of this input stream as a signed 8-bit
byte. - Throws:
EOFException- if this input stream has reached the end.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readUnsignedByte
See the general contract of thereadUnsignedBytemethod ofDataInput.Bytes for this operation are read from the contained input stream.
- Returns:
- the next byte of this input stream, interpreted as an unsigned 8-bit number.
- Throws:
EOFException- if this input stream has reached the end.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readShort
Bytes for this operation are read from the contained input stream.- Returns:
- the next two bytes of this input stream, interpreted as a signed 16-bit number.
- Throws:
EOFException- if this input stream reaches the end before reading two bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readUnsignedShort
Bytes for this operation are read from the contained input stream.- Returns:
- the next two bytes of this input stream, interpreted as an unsigned 16-bit integer.
- Throws:
EOFException- if this input stream reaches the end before reading two bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readInt
Bytes for this operation are read from the contained input stream.- Returns:
- the next four bytes of this input stream, interpreted as an
int. - Throws:
EOFException- if this input stream reaches the end before reading four bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readLong
Bytes for this operation are read from the contained input stream.- Returns:
- the next eight bytes of this input stream, interpreted as a
long. - Throws:
EOFException- if this input stream reaches the end before reading eight bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readFloat
Bytes for this operation are read from the contained input stream.- Returns:
- the next four bytes of this input stream, interpreted as a
float. - Throws:
EOFException- if this input stream reaches the end before reading four bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-
readDouble
Bytes for this operation are read from the contained input stream.- Returns:
- the next eight bytes of this input stream, interpreted as a
double. - Throws:
EOFException- if this input stream reaches the end before reading eight bytes.IOException- the stream has been closed and the contained input stream does not support reading after close, or another I/O error occurs.- See Also:
-