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 intermediate buffer is then copied to the requesting buffer bts at the appropriate offset.
  • Constructor Details

    • InputStreamWithZeroOffsetRead

      public InputStreamWithZeroOffsetRead(InputStream proxy)
      Constructs a new ProxyInputStream.
      Parameters:
      proxy - the InputStream to delegate to
  • Method Details

    • read

      public int read(byte[] bts, int off, int len) throws IOException
      Overrides:
      read in class org.apache.commons.io.input.ProxyInputStream
      Throws:
      IOException