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:
- Closeable, 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.
Methods inherited from class org.apache.hadoop.fs.FSInputStream |
read, readFully, readFully |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FSDigestInputStream
public FSDigestInputStream(InputStream inputStream,
String digestHex)
throws IOException
- Constructor FSDigestInputStream creates a new FSDigestInputStream instance.
- Parameters:
inputStream
- of type InputStreamdigestHex
- of type String
- Throws:
IOException
- if unable to get md5 digest
FSDigestInputStream
public FSDigestInputStream(InputStream inputStream,
MessageDigest messageDigest,
String digestHex)
- Constructor FSDigestInputStream creates a new FSDigestInputStream instance.
- Parameters:
inputStream
- of type InputStreammessageDigest
- of type MessageDigestdigestHex
- of type String
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
seek
public void seek(long pos)
throws IOException
- Specified by:
seek
in interface org.apache.hadoop.fs.Seekable
- Specified by:
seek
in class org.apache.hadoop.fs.FSInputStream
- Throws:
IOException
getPos
public long getPos()
throws IOException
- Specified by:
getPos
in interface org.apache.hadoop.fs.Seekable
- Specified by:
getPos
in class org.apache.hadoop.fs.FSInputStream
- Throws:
IOException
seekToNewSource
public boolean seekToNewSource(long targetPos)
throws IOException
- Specified by:
seekToNewSource
in interface org.apache.hadoop.fs.Seekable
- Specified by:
seekToNewSource
in class org.apache.hadoop.fs.FSInputStream
- Throws:
IOException
Copyright © 2007-2013 Concurrent, Inc. All Rights Reserved.