org.apache.hadoop.hdfs.server.namenode
Class FSEditLogLoader.PositionTrackingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader.PositionTrackingInputStream
- All Implemented Interfaces:
- Closeable
- Enclosing class:
- org.apache.hadoop.hdfs.server.namenode.FSEditLogLoader
public static class FSEditLogLoader.PositionTrackingInputStream
- extends FilterInputStream
Stream wrapper that keeps track of the current stream position.
This stream also allows us to set a limit on how many bytes we can read
without getting an exception.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FSEditLogLoader.PositionTrackingInputStream
public FSEditLogLoader.PositionTrackingInputStream(InputStream is)
read
public int read()
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] data)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] data,
int offset,
int length)
throws IOException
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
setLimit
public void setLimit(long limit)
- Set a limit. Calling this function clears any existing limit.
clearLimit
public void clearLimit()
- Disable limit.
mark
public void mark(int limit)
- Overrides:
mark
in class FilterInputStream
reset
public void reset()
throws IOException
- Overrides:
reset
in class FilterInputStream
- Throws:
IOException
getPos
public long getPos()
skip
public long skip(long amt)
throws IOException
- Overrides:
skip
in class FilterInputStream
- Throws:
IOException
Copyright © 2014 Apache Software Foundation. All Rights Reserved.