Package org.apache.cassandra.io.util
Class WrappedDataOutputStreamPlus
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.cassandra.io.util.DataOutputStreamPlus
-
- org.apache.cassandra.io.util.UnbufferedDataOutputStreamPlus
-
- org.apache.cassandra.io.util.WrappedDataOutputStreamPlus
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.DataOutput
,java.io.Flushable
,java.lang.AutoCloseable
,DataOutputPlus
public class WrappedDataOutputStreamPlus extends UnbufferedDataOutputStreamPlus
When possible useWrappedDataOutputStreamPlus
instead of this class, as it will be more efficient when using Plus methods. This class is only for situations where it cannot be used. The channel provided by this class is just a wrapper around the output stream.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.OutputStream
out
-
Fields inherited from class org.apache.cassandra.io.util.DataOutputStreamPlus
channel
-
-
Constructor Summary
Constructors Constructor Description WrappedDataOutputStreamPlus(java.io.OutputStream out)
WrappedDataOutputStreamPlus(java.io.OutputStream out, java.nio.channels.WritableByteChannel channel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
void
write(byte[] buffer, int offset, int count)
Writescount
bytes from the byte arraybuffer
starting atoffset
to this RandomAccessFile starting at the current file pointer..void
write(int oneByte)
Writes the specified byteoneByte
to this RandomAccessFile starting at the current file pointer.-
Methods inherited from class org.apache.cassandra.io.util.UnbufferedDataOutputStreamPlus
write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF, writeUTF
-
Methods inherited from class org.apache.cassandra.io.util.DataOutputStreamPlus
newDefaultChannel, retrieveTemporaryBuffer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.io.util.DataOutputPlus
bytesLeftInPage, hasPosition, maxBytesInPage, paddedPosition, padToPageBoundary, position, write, writeMostSignificantBytes, writeUnsignedVInt, writeUnsignedVInt, writeUnsignedVInt32, writeVInt, writeVInt, writeVInt32
-
-
-
-
Method Detail
-
write
public void write(byte[] buffer, int offset, int count) throws java.io.IOException
Description copied from class:UnbufferedDataOutputStreamPlus
Writescount
bytes from the byte arraybuffer
starting atoffset
to this RandomAccessFile starting at the current file pointer..- Specified by:
write
in interfacejava.io.DataOutput
- Specified by:
write
in classUnbufferedDataOutputStreamPlus
- Parameters:
buffer
- the bytes to be writtenoffset
- offset in buffer to get bytescount
- number of bytes in buffer to write- Throws:
java.io.IOException
- If an error occurs attempting to write to this RandomAccessFile.
-
write
public void write(int oneByte) throws java.io.IOException
Description copied from class:UnbufferedDataOutputStreamPlus
Writes the specified byteoneByte
to this RandomAccessFile starting at the current file pointer. Only the low order byte ofoneByte
is written.- Specified by:
write
in interfacejava.io.DataOutput
- Specified by:
write
in classUnbufferedDataOutputStreamPlus
- Parameters:
oneByte
- the byte to be written- Throws:
java.io.IOException
- If an error occurs attempting to write to this RandomAccessFile.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
-