cascading.tap.hadoop.io

## Class FSDigestInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.hadoop.fs.FSInputStream
    - - cascading.tap.hadoop.io.FSDigestInputStream

All Implemented Interfaces:
  java.io.Closeable, java.lang.AutoCloseable, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable

    public class FSDigestInputStream
    extends org.apache.hadoop.fs.FSInputStream

Class FSDigestInputStream is an `FSInputStream` implementation that can verify a `MessageDigest` and will count the number of bytes read for use in progress status.

### Constructor Summary

Constructors
Constructor and Description
`FSDigestInputStream(java.io.InputStream inputStream, java.security.MessageDigest messageDigest, java.lang.String digestHex)` Constructor FSDigestInputStream creates a new FSDigestInputStream instance.
`FSDigestInputStream(java.io.InputStream inputStream, java.lang.String digestHex)` Constructor FSDigestInputStream creates a new FSDigestInputStream instance.

### Method Summary

Methods
`void` `close()`
`long` `getPos()`
`int` `read()`
`int` `read(byte[] b, int off, int len)`
`void` `seek(long pos)`
`boolean` `seekToNewSource(long targetPos)`

### Methods inherited from class org.apache.hadoop.fs.FSInputStream

`read, readFully, readFully`

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

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

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

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

### Constructor Detail

#### FSDigestInputStream

    public FSDigestInputStream(java.io.InputStream inputStream,
                       java.lang.String digestHex)
                        throws java.io.IOException

Constructor FSDigestInputStream creates a new FSDigestInputStream instance.

Parameters:
  `inputStream` - of type InputStream
  `digestHex` - of type String
Throws:
  `java.io.IOException` - if unable to get md5 digest

#### FSDigestInputStream

    public FSDigestInputStream(java.io.InputStream inputStream,
                       java.security.MessageDigest messageDigest,
                       java.lang.String digestHex)

Constructor FSDigestInputStream creates a new FSDigestInputStream instance.

Parameters:
  `inputStream` - of type InputStream
  `messageDigest` - of type MessageDigest
  `digestHex` - of type String

### 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`

#### close

    public void close()
               throws java.io.IOException

Specified by:
  `close` in interface `java.io.Closeable`
Specified by:
  `close` in interface `java.lang.AutoCloseable`
Overrides:
  `close` in class `java.io.InputStream`
Throws:
  `java.io.IOException`

#### seek

    public void seek(long pos)
              throws java.io.IOException

Specified by:
  `seek` in interface `org.apache.hadoop.fs.Seekable`
Specified by:
  `seek` in class `org.apache.hadoop.fs.FSInputStream`
Throws:
  `java.io.IOException`

#### getPos

    public long getPos()
                throws java.io.IOException

Specified by:
  `getPos` in interface `org.apache.hadoop.fs.Seekable`
Specified by:
  `getPos` in class `org.apache.hadoop.fs.FSInputStream`
Throws:
  `java.io.IOException`

#### seekToNewSource

    public boolean seekToNewSource(long targetPos)
                            throws java.io.IOException

Specified by:
  `seekToNewSource` in interface `org.apache.hadoop.fs.Seekable`
Specified by:
  `seekToNewSource` in class `org.apache.hadoop.fs.FSInputStream`
Throws:
  `java.io.IOException`