Class 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.
    • 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 class org.apache.commons.io.input.ProxyInputStream
        Throws:
        IOException