org.apache.hadoop.mapred
Class IFileOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.hadoop.mapred.IFileOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
@InterfaceAudience.Private
@InterfaceStability.Unstable
public class IFileOutputStream
- extends FilterOutputStream
A Checksum output stream.
Checksum for the contents of the file is calculated and
appended to the end of the file on close of the stream.
Used for IFiles
Method Summary |
void |
close()
|
void |
finish()
Finishes writing data to the output stream, by writing
the checksum bytes to the end. |
void |
write(byte[] b,
int off,
int len)
Write bytes to the stream. |
void |
write(int b)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IFileOutputStream
public IFileOutputStream(OutputStream out)
- Create a checksum output stream that writes
the bytes to the given stream.
- Parameters:
out
-
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterOutputStream
- Throws:
IOException
finish
public void finish()
throws IOException
- Finishes writing data to the output stream, by writing
the checksum bytes to the end. The underlying stream is not closed.
- Throws:
IOException
write
public void write(byte[] b,
int off,
int len)
throws IOException
- Write bytes to the stream.
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
write
public void write(int b)
throws IOException
- Overrides:
write
in class FilterOutputStream
- Throws:
IOException
Copyright © 2013 Apache Software Foundation. All Rights Reserved.