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, PositionedReadable, Seekable
public class FSDigestInputStream
- extends 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 |
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. |
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 |
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 InputStreamdigestHex
- 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 InputStreammessageDigest
- of type MessageDigestdigestHex
- of type String
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
- 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 Seekable
- Specified by:
seek
in class FSInputStream
- Throws:
java.io.IOException
getPos
public long getPos()
throws java.io.IOException
- Specified by:
getPos
in interface Seekable
- Specified by:
getPos
in class FSInputStream
- Throws:
java.io.IOException
seekToNewSource
public boolean seekToNewSource(long targetPos)
throws java.io.IOException
- Specified by:
seekToNewSource
in interface Seekable
- Specified by:
seekToNewSource
in class FSInputStream
- Throws:
java.io.IOException
Copyright © 2007-2011 Concurrent, Inc. All Rights Reserved.