org.apache.hadoop.hdfs.server.namenode
Class FSEditLogLoader.PositionTrackingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by 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.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
FSEditLogLoader.PositionTrackingInputStream(InputStream is)
           
 
Method Summary
 void clearLimit()
          Disable limit.
 long getPos()
           
 void mark(int limit)
           
 int read()
           
 int read(byte[] data)
           
 int read(byte[] data, int offset, int length)
           
 void reset()
           
 void setLimit(long limit)
          Set a limit.
 long skip(long amt)
           
 
Methods inherited from class java.io.FilterInputStream
available, close, markSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSEditLogLoader.PositionTrackingInputStream

public FSEditLogLoader.PositionTrackingInputStream(InputStream is)
Method Detail

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.