code: private void advance()
              throws IOException
      {
          if (compressedSliceInput == null || compressedSliceInput.remaining() == 0) {
              current = null;
              return;
          }
  
          // 3 byte header
          // NOTE: this must match BLOCK_HEADER_SIZE
          currentCompressedBlockOffset = toIntExact(compressedSliceInput.position());
          int b0 = compressedSliceInput.readUnsignedByte();
          int b1 = compressedSliceInput.readUnsignedByte();
          int b2 = compressedSliceInput.readUnsignedByte();
  
          boolean isUncompressed = (b0 & 0x01) == 1;
          int chunkLength = (b2 << 15) | (b1 << 7) | (b0 >>> 1);
          if (chunkLength < 0 || chunkLength > compressedSliceInput.remaining()) {
              throw new OrcCorruptionException(orcDataSourceId, "The chunkLength (%s) must not be negative or greater than remaining size (%s)", chunkLength, compressedSliceInput.remaining());
          }
  
          Slice chunk = compressedSliceInput.readSlice(chunkLength);
  
          if (isUncompressed) {
              current = chunk.getInput();
          }
          else {
              OrcDecompressor.OutputBuffer output = new OrcDecompressor.OutputBuffer()
              {
                  @Override
                  public byte[] initialize(int size)
                  {
                      if (buffer == null || size > buffer.length) {
                          buffer = new byte[size];
                          bufferMemoryUsage.setBytes(buffer.length);
                      }
                      return buffer;
                  }
  
                  @Override
                  public byte[] grow(int size)
                  {
                      if (size > buffer.length) {
                          buffer = Arrays.copyOfRange(buffer, 0, size);
                          bufferMemoryUsage.setBytes(buffer.length);
                      }
                      return buffer;
                  }
              };
  
              int uncompressedSize = decompressor.get().decompress((byte[]) chunk.getBase(), (int) (chunk.getAddress() - ARRAY_BYTE_BASE_OFFSET), chunk.length(), output);
              current = Slices.wrappedBuffer(buffer, 0, uncompressedSize).getInput();
          }
      }
docs: This comes from the Apache Hive ORC code