Package cn.sliew.milky.io
Interface DataInputView
-
- All Superinterfaces:
AutoCloseable,Closeable,DataInput,Serializable
public interface DataInputView extends DataInput, Closeable, Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanreadBoolean()Reads a 1 byte boolean.voidreadBytes(byte[] b)voidreadBytes(byte[] b, int offset, int len)default charreadChar()Reads a 2 byte char.default doublereadDouble()Reads an 8 byte double.default floatreadFloat()Reads a 4 byte float.default voidreadFully(byte[] b)default voidreadFully(byte[] b, int off, int len)default intreadInt()Reads a 4 byte int.default longreadLong()Reads an 8 byte long.default BooleanreadOptionalBoolean()Reads an optionalBoolean.default DoublereadOptionalDouble()default FloatreadOptionalFloat()default IntegerreadOptionalInt()Reads an optionalInteger.default LongreadOptionalLong()Reads an optionalLong.default IntegerreadOptionalVInt()default LongreadOptionalVLong()default IntegerreadOptionalZInt()default LongreadOptionalZLong()default shortreadShort()Reads a 2 byte short.default intreadUnsignedShort()Reads a 2 byte short as an int from 0 to 65535.default doublereadVarDouble(double precision)Reads a 1-9 byte double with reduced precision.default floatreadVFloat(float precision, boolean optimizePositive)Reads a 1-5 byte float with reduced precision.default intreadVInt()Reads an int stored in variable-length format.default longreadVLong()Reads a long stored in variable-length format.default intreadZInt()Reads azig-zag-encodedvariable-lengthinteger.default longreadZLong()
-
-
-
Method Detail
-
readBytes
void readBytes(byte[] b) throws IOException- Throws:
IOException
-
readBytes
void readBytes(byte[] b, int offset, int len) throws IOException- Throws:
IOException
-
readFully
default void readFully(byte[] b) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
default void readFully(byte[] b, int off, int len) throws IOException- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readBoolean
default boolean readBoolean() throws IOExceptionReads a 1 byte boolean.- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readOptionalBoolean
default Boolean readOptionalBoolean() throws IOException
Reads an optionalBoolean.- Throws:
IOException
-
readShort
default short readShort() throws IOExceptionReads a 2 byte short.- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUnsignedShort
default int readUnsignedShort() throws IOExceptionReads a 2 byte short as an int from 0 to 65535.- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
readChar
default char readChar() throws IOExceptionReads a 2 byte char.- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readInt
default int readInt() throws IOExceptionReads a 4 byte int.- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readVInt
default int readVInt() throws IOExceptionReads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers will always use all 5 bytes and are therefore better serialized usingreadInt()orreadZInt()- Throws:
IOException
-
readZInt
default int readZInt() throws IOExceptionReads azig-zag-encodedvariable-lengthinteger.- Throws:
IOException- See Also:
DataOutputView.writeZInt(int)
-
readOptionalInt
default Integer readOptionalInt() throws IOException
Reads an optionalInteger.- Throws:
IOException
-
readOptionalVInt
default Integer readOptionalVInt() throws IOException
- Throws:
IOException
-
readOptionalZInt
default Integer readOptionalZInt() throws IOException
- Throws:
IOException
-
readLong
default long readLong() throws IOExceptionReads an 8 byte long.- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readVLong
default long readVLong() throws IOExceptionReads a long stored in variable-length format. Reads between one and ten bytes. Smaller values take fewer bytes. Negative numbers are encoded in ten bytes so preferreadLong()orreadZLong()for negative numbers.- Throws:
IOException
-
readZLong
default long readZLong() throws IOException- Throws:
IOException
-
readOptionalLong
default Long readOptionalLong() throws IOException
Reads an optionalLong.- Throws:
IOException
-
readOptionalVLong
default Long readOptionalVLong() throws IOException
- Throws:
IOException
-
readOptionalZLong
default Long readOptionalZLong() throws IOException
- Throws:
IOException
-
readFloat
default float readFloat() throws IOExceptionReads a 4 byte float.- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readVFloat
default float readVFloat(float precision, boolean optimizePositive) throws IOExceptionReads a 1-5 byte float with reduced precision.- Throws:
IOException
-
readVarDouble
default double readVarDouble(double precision) throws IOExceptionReads a 1-9 byte double with reduced precision.- Throws:
IOException
-
readOptionalFloat
default Float readOptionalFloat() throws IOException
- Throws:
IOException
-
readDouble
default double readDouble() throws IOExceptionReads an 8 byte double.- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readOptionalDouble
default Double readOptionalDouble() throws IOException
- Throws:
IOException
-
-