org.apache.hadoop.fs
Class FSDataOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.apache.hadoop.fs.FSDataOutputStream
- All Implemented Interfaces:
- Closeable, DataOutput, Flushable, Syncable
@InterfaceAudience.Public
@InterfaceStability.Stable
public class FSDataOutputStream
- extends DataOutputStream
- implements Syncable
Utility that wraps a OutputStream
in a DataOutputStream
,
buffers output through a BufferedOutputStream
and creates a checksum
file.
Method Summary |
void |
close()
|
long |
getPos()
|
OutputStream |
getWrappedStream()
|
void |
hflush()
Flush out the data in client's user buffer. |
void |
hsync()
Similar to posix fsync, flush out the data in client's user buffer
all the way to the disk device (but the disk may have it in its cache). |
void |
sync()
Deprecated. |
Methods inherited from class java.io.DataOutputStream |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FSDataOutputStream
@Deprecated
public FSDataOutputStream(OutputStream out)
throws IOException
- Deprecated.
- Throws:
IOException
FSDataOutputStream
public FSDataOutputStream(OutputStream out,
FileSystem.Statistics stats)
throws IOException
- Throws:
IOException
FSDataOutputStream
public FSDataOutputStream(OutputStream out,
FileSystem.Statistics stats,
long startPosition)
throws IOException
- Throws:
IOException
getPos
public long getPos()
throws IOException
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class FilterOutputStream
- Throws:
IOException
getWrappedStream
public OutputStream getWrappedStream()
sync
@Deprecated
public void sync()
throws IOException
- Deprecated.
- Specified by:
sync
in interface Syncable
- Throws:
IOException
- See Also:
Syncable.hflush()
hflush
public void hflush()
throws IOException
- Description copied from interface:
Syncable
- Flush out the data in client's user buffer. After the return of
this call, new readers will see the data.
- Specified by:
hflush
in interface Syncable
- Throws:
IOException
- if any error occurs
hsync
public void hsync()
throws IOException
- Description copied from interface:
Syncable
- Similar to posix fsync, flush out the data in client's user buffer
all the way to the disk device (but the disk may have it in its cache).
- Specified by:
hsync
in interface Syncable
- Throws:
IOException
- if error occurs
Copyright © 2009 The Apache Software Foundation