Package net.sansa_stack.io.util
Class InputStreamWithZeroOffsetRead
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.commons.io.input.ProxyInputStream
-
- net.sansa_stack.io.util.InputStreamWithZeroOffsetRead
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class InputStreamWithZeroOffsetRead extends org.apache.commons.io.input.ProxyInputStream
Workaround for HADOOP-17453: read(bts, off, len) with off != 0 is broken in several version of BZip2Codec Invoking read with a non-zero offset creates a in intermediate buffer to which is read with a zero offset The content of the intermidate buffer is then copied to the requesting buffer bts at the appropriate offset.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description InputStreamWithZeroOffsetRead(InputStream proxy)
Constructs a new ProxyInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read(byte[] bts, int off, int len)
-
Methods inherited from class org.apache.commons.io.input.ProxyInputStream
afterRead, available, beforeRead, close, handleIOException, mark, markSupported, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
InputStreamWithZeroOffsetRead
public InputStreamWithZeroOffsetRead(InputStream proxy)
Constructs a new ProxyInputStream.- Parameters:
proxy
- the InputStream to delegate to
-
-
Method Detail
-
read
public int read(byte[] bts, int off, int len) throws IOException
- Overrides:
read
in classorg.apache.commons.io.input.ProxyInputStream
- Throws:
IOException
-
-