Package org.apache.cassandra.io.util
Class TrackedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.cassandra.io.util.TrackedInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,BytesReadTracker
public class TrackedInputStream extends java.io.FilterInputStream implements BytesReadTracker
This class is to track bytes read from given DataInputStream
-
-
Constructor Summary
Constructors Constructor Description TrackedInputStream(java.io.InputStream source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBytesRead()
int
read()
int
read(byte[] b)
int
read(byte[] b, int off, int len)
void
reset(long count)
reset counter to @param countlong
skip(long n)
-
-
-
Method Detail
-
getBytesRead
public long getBytesRead()
- Specified by:
getBytesRead
in interfaceBytesReadTracker
-
reset
public void reset(long count)
reset counter to @param count- Specified by:
reset
in interfaceBytesReadTracker
-
read
public int read() throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
read
public int read(byte[] b) throws java.io.IOException
- Overrides:
read
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
skip
public long skip(long n) throws java.io.IOException
- Overrides:
skip
in classjava.io.FilterInputStream
- Throws:
java.io.IOException
-
-