Package org.apache.cassandra.io.util
Interface DataInputPlus
-
- All Superinterfaces:
java.io.DataInput
- All Known Subinterfaces:
FileDataInput
,RewindableDataInput
- All Known Implementing Classes:
AsyncStreamingInputPlus
,ChecksummedDataInput
,CompressedChecksummedDataInput
,CompressedInputStream
,DataInputBuffer
,DataInputPlus.DataInputStreamPlus
,EncryptedChecksummedDataInput
,EncryptedFileSegmentInputStream
,FileSegmentInputStream
,MemoryInputStream
,NIODataInputStream
,RandomAccessReader
,RebufferingInputStream
,RewindableDataInputStreamPlus
,StreamCompressionInputStream
,TrackedDataInputPlus
public interface DataInputPlus extends java.io.DataInput
Extension to DataInput that provides support for reading varints
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DataInputPlus.DataInputStreamPlus
Wrapper around an InputStream that provides no buffering but can decode varints
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default long
readUnsignedVInt()
Think hard before opting for an unsigned encoding.default long
readVInt()
int
skipBytes(int n)
Always skips the requested number of bytes, unless EOF is reacheddefault void
skipBytesFully(int n)
-
-
-
Method Detail
-
readVInt
default long readVInt() throws java.io.IOException
- Throws:
java.io.IOException
-
readUnsignedVInt
default long readUnsignedVInt() throws java.io.IOException
Think hard before opting for an unsigned encoding. Is this going to bite someone because some day they might need to pass in a sentinel value using negative numbers? Is the risk worth it to save a few bytes? Signed, not a fan of unsigned values in protocols and formats- Throws:
java.io.IOException
-
skipBytes
int skipBytes(int n) throws java.io.IOException
Always skips the requested number of bytes, unless EOF is reached- Specified by:
skipBytes
in interfacejava.io.DataInput
- Parameters:
n
- number of bytes to skip- Returns:
- number of bytes skipped
- Throws:
java.io.IOException
-
skipBytesFully
default void skipBytesFully(int n) throws java.io.IOException
- Throws:
java.io.IOException
-
-