org.apache.hadoop.util
Class LimitInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by org.apache.hadoop.util.LimitInputStream
All Implemented Interfaces:
Closeable

@InterfaceStability.Unstable
public final class LimitInputStream
extends FilterInputStream

Copied from guava source code v15 (LimitedInputStream) Guava deprecated LimitInputStream in v14 and removed it in v15. Copying this class here allows to be compatible with guava 11 to 15+. Originally: org.apache.hadoop.hbase.io.LimitInputStream


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
LimitInputStream(InputStream in, long limit)
           
 
Method Summary
 int available()
           
 void mark(int readLimit)
           
 int read()
           
 int read(byte[] b, int off, int len)
           
 void reset()
           
 long skip(long n)
           
 
Methods inherited from class java.io.FilterInputStream
close, markSupported, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LimitInputStream

public LimitInputStream(InputStream in,
                        long limit)
Method Detail

available

public int available()
              throws IOException
Overrides:
available in class FilterInputStream
Throws:
IOException

mark

public void mark(int readLimit)
Overrides:
mark in class FilterInputStream

read

public int read()
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Overrides:
read in class FilterInputStream
Throws:
IOException

reset

public void reset()
           throws IOException
Overrides:
reset in class FilterInputStream
Throws:
IOException

skip

public long skip(long n)
          throws IOException
Overrides:
skip in class FilterInputStream
Throws:
IOException


Copyright © 2014 Apache Software Foundation. All Rights Reserved.