java.io.Closeable, java.io.DataOutput, java.io.Flushable, java.lang.AutoCloseable, Abortable, CanSetDropBehind, IOStatisticsSource, StreamCapabilities, SyncableCryptoFSDataOutputStream@Public @Stable public class FSDataOutputStream extends java.io.DataOutputStream implements Syncable, CanSetDropBehind, StreamCapabilities, IOStatisticsSource, Abortable
OutputStream in a DataOutputStream.Abortable.AbortableResultStreamCapabilities.StreamCapabilityABORTABLE_STREAM, DROPBEHIND, HFLUSH, HSYNC, IOSTATISTICS, IOSTATISTICS_CONTEXT, PREADBYTEBUFFER, READAHEAD, READBYTEBUFFER, UNBUFFER, VECTOREDIO| Constructor | Description |
|---|---|
FSDataOutputStream(java.io.OutputStream out,
FileSystem.Statistics stats) |
|
FSDataOutputStream(java.io.OutputStream out,
FileSystem.Statistics stats,
long startPosition) |
| Modifier and Type | Method | Description |
|---|---|---|
Abortable.AbortableResult |
abort() |
Invoke
abort() on the wrapped stream if it
is Abortable, otherwise raise an
UnsupportedOperationException. |
void |
close() |
Close the underlying output stream.
|
long[] |
getFidServers() |
|
IOStatistics |
getIOStatistics() |
Get the IO Statistics of the nested stream, falling back to
empty statistics if the stream does not implement the interface
IOStatisticsSource. |
long |
getPos() |
Get the current position in the output stream.
|
java.io.OutputStream |
getWrappedStream() |
Get a reference to the wrapped output stream.
|
boolean |
hasCapability(java.lang.String capability) |
Query the stream for a specific capability.
|
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 |
seek(long pos) |
|
void |
setDropBehind(java.lang.Boolean dropBehind) |
Configure whether the stream should drop the cache.
|
void |
sync() |
Deprecated.
|
java.lang.String |
toString() |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFpublic FSDataOutputStream(java.io.OutputStream out,
FileSystem.Statistics stats)
public FSDataOutputStream(java.io.OutputStream out,
FileSystem.Statistics stats,
long startPosition)
public long getPos()
public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.FilterOutputStreamjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object@LimitedPrivate("HDFS")
public java.io.OutputStream getWrappedStream()
public boolean hasCapability(java.lang.String capability)
StreamCapabilitieshasCapability in interface StreamCapabilitiescapability - string to query the stream support for.@Deprecated
public void sync()
throws java.io.IOException
sync in interface Syncablejava.io.IOExceptionSyncable.hflush()public void hflush()
throws java.io.IOException
Syncablepublic void hsync()
throws java.io.IOException
Syncablepublic void setDropBehind(java.lang.Boolean dropBehind)
throws java.io.IOException
CanSetDropBehindsetDropBehind in interface CanSetDropBehinddropBehind - Whether to drop the cache. null means to use the
default value.java.io.IOException - If there was an error changing the dropBehind
setting.
UnsupportedOperationException If this stream doesn't support
setting the drop-behind.public IOStatistics getIOStatistics()
IOStatisticsSource.getIOStatistics in interface IOStatisticsSourcepublic Abortable.AbortableResult abort()
abort() on the wrapped stream if it
is Abortable, otherwise raise an
UnsupportedOperationException.public long[] getFidServers()
throws java.io.IOException
java.io.IOExceptionpublic void seek(long pos)
throws java.io.IOException
java.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.