com.cloudera.sqoop.io
Class FixedLengthInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.ProxyInputStream
com.cloudera.sqoop.io.FixedLengthInputStream
- All Implemented Interfaces:
- java.io.Closeable
public class FixedLengthInputStream
- extends org.apache.commons.io.input.ProxyInputStream
Provides an InputStream that can consume a fixed maximum number of bytes
from an underlying stream. Closing the FixedLengthInputStream does not
close the underlying stream. After reading the maximum number of available
bytes this acts as though EOF has been reached.
Fields inherited from class java.io.FilterInputStream |
in |
Method Summary |
int |
available()
|
int |
read()
|
int |
read(byte[] buf)
|
int |
read(byte[] buf,
int start,
int count)
|
Methods inherited from class org.apache.commons.io.input.ProxyInputStream |
close, mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedLengthInputStream
public FixedLengthInputStream(java.io.InputStream stream,
long maxLen)
available
public int available()
throws java.io.IOException
- Overrides:
available
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Overrides:
read
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf)
throws java.io.IOException
- Overrides:
read
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
java.io.IOException
read
public int read(byte[] buf,
int start,
int count)
throws java.io.IOException
- Overrides:
read
in class org.apache.commons.io.input.ProxyInputStream
- Throws:
java.io.IOException
Copyright © 2010 Cloudera, Inc.