com.amazon.redshift.core

## Class CompressedInputStream

- java.lang.Object
- - java.io.InputStream
  - - com.amazon.redshift.core.CompressedInputStream

All Implemented Interfaces:
  Closeable, AutoCloseable

    public class CompressedInputStream
    extends InputStream

### Constructor Summary

Constructors
Constructor and Description
`CompressedInputStream(InputStream in, RedshiftLogger in_logger)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`int` `available()`
`void` `close()`
`long` `getBytesReadFromStream()`
`static int` `lz4_decompress(byte[] compressed, int position, int compressedLen, byte[] dest, int dOff, RedshiftLogger logger)` Implementation of lz4 decompression.
`int` `read()`
`int` `read(byte[] b, int off, int len)`
`long` `skip(long n)`

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

`mark, markSupported, read, reset`

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

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

### Constructor Detail

#### CompressedInputStream

    public CompressedInputStream(InputStream in,
                                 RedshiftLogger in_logger)

### Method Detail

#### read

    public int read()
             throws IOException

Specified by:
  `read` in class `InputStream`
Throws:
  `IOException`

#### getBytesReadFromStream

    public long getBytesReadFromStream()

#### lz4_decompress

    public static int lz4_decompress(byte[] compressed,
                                     int position,
                                     int compressedLen,
                                     byte[] dest,
                                     int dOff,
                                     RedshiftLogger logger)
                              throws IOException

Implementation of lz4 decompression. Curently I could not make any library to do stream decompression as is required by LZ4_decompress_safe_continue().

Throws:
  `IOException`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Overrides:
  `close` in class `InputStream`
Throws:
  `IOException`

#### available

    public int available()
                  throws IOException

Overrides:
  `available` in class `InputStream`
Throws:
  `IOException`

#### skip

    public long skip(long n)
              throws IOException

Overrides:
  `skip` in class `InputStream`
Throws:
  `IOException`

#### read

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

Overrides:
  `read` in class `InputStream`
Throws:
  `IOException`