Package org.apache.cassandra.io.util
Class TrackedDataInputPlus
java.lang.Object
org.apache.cassandra.io.util.TrackedDataInputPlus
- All Implemented Interfaces:
DataInput,BytesReadTracker,DataInputPlus
This class is to track bytes read from given DataInput
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.io.util.DataInputPlus
DataInputPlus.DataInputStreamPlus -
Constructor Summary
ConstructorsConstructorDescriptionTrackedDataInputPlus(DataInput source) Create a TrackedDataInputPlus from given DataInput with no limit of bytes to readTrackedDataInputPlus(DataInput source, long limit) Create a TrackedDataInputPlus from given DataInput with limit of bytes to read. -
Method Summary
Modifier and TypeMethodDescriptionlongbooleanbytereadByte()charreadChar()doublefloatvoidreadFully(byte[] b) voidreadFully(byte[] b, int off, int len) intreadInt()readLine()longreadLong()shortintintreadUTF()voidreset(long count) reset counter to @param countintskipBytes(int n) Always skips the requested number of bytes, unless EOF is reachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.io.util.DataInputPlus
readUnsignedVInt, readUnsignedVInt32, readVInt, readVInt32, skipBytesFully
-
Constructor Details
-
TrackedDataInputPlus
Create a TrackedDataInputPlus from given DataInput with no limit of bytes to read -
TrackedDataInputPlus
Create a TrackedDataInputPlus from given DataInput with limit of bytes to read. If limit is reachedIOExceptionwill be thrown when trying to read more bytes.
-
-
Method Details
-
getBytesRead
public long getBytesRead()- Specified by:
getBytesReadin interfaceBytesReadTracker
-
reset
public void reset(long count) reset counter to @param count- Specified by:
resetin interfaceBytesReadTracker
-
readBoolean
- Specified by:
readBooleanin interfaceDataInput- Throws:
IOException
-
readByte
- Specified by:
readBytein interfaceDataInput- Throws:
IOException
-
readChar
- Specified by:
readCharin interfaceDataInput- Throws:
IOException
-
readDouble
- Specified by:
readDoublein interfaceDataInput- Throws:
IOException
-
readFloat
- Specified by:
readFloatin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readFully
- Specified by:
readFullyin interfaceDataInput- Throws:
IOException
-
readInt
- Specified by:
readIntin interfaceDataInput- Throws:
IOException
-
readLine
- Specified by:
readLinein interfaceDataInput- Throws:
IOException
-
readLong
- Specified by:
readLongin interfaceDataInput- Throws:
IOException
-
readShort
- Specified by:
readShortin interfaceDataInput- Throws:
IOException
-
readUTF
- Specified by:
readUTFin interfaceDataInput- Throws:
IOException
-
readUnsignedByte
- Specified by:
readUnsignedBytein interfaceDataInput- Throws:
IOException
-
readUnsignedShort
- Specified by:
readUnsignedShortin interfaceDataInput- Throws:
IOException
-
skipBytes
Description copied from interface:DataInputPlusAlways skips the requested number of bytes, unless EOF is reached- Specified by:
skipBytesin interfaceDataInput- Specified by:
skipBytesin interfaceDataInputPlus- Parameters:
n- number of bytes to skip- Returns:
- number of bytes skipped
- Throws:
IOException
-