org.apache.cassandra.streaming.compress

## Class CompressedInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.cassandra.streaming.compress.CompressedInputStream

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

      public class CompressedInputStream
      extends java.io.InputStream

  InputStream which reads data from underlining source with given `CompressionInfo`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `bufferOffset`
    `protected java.io.IOException` | `readException`
    `protected int` | `validBufferBytes`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CompressedInputStream(java.io.InputStream source, CompressionInfo info, ChecksumType checksumType, java.util.function.Supplier<java.lang.Double> crcCheckChanceSupplier)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getTotalCompressedBytesRead()`
    `void` | `position(long position)`
    `int` | `read()`
    `int` | `read(byte[] b, int off, int len)`

    - ### Methods inherited from class java.io.InputStream

      `available, close, mark, markSupported, read, reset, skip`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### bufferOffset

          protected long bufferOffset

    - #### validBufferBytes

          protected int validBufferBytes

    - #### readException

          protected volatile java.io.IOException readException

  - ### Constructor Detail

    - #### CompressedInputStream

          public CompressedInputStream(java.io.InputStream source,
                                       CompressionInfo info,
                                       ChecksumType checksumType,
                                       java.util.function.Supplier<java.lang.Double> crcCheckChanceSupplier)

      Parameters:
        `source` - Input source to read compressed data from
        `info` - Compression info

  - ### Method Detail

    - #### read

          public int read()
                   throws java.io.IOException

      Specified by:
        `read` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### read

          public int read(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException

      Overrides:
        `read` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### position

          public void position(long position)

    - #### getTotalCompressedBytesRead

          public long getTotalCompressedBytesRead()

Copyright © 2018 The Apache Software Foundation