Package org.apache.cassandra.io.util
Class BufferedDataOutputStreamPlus
java.lang.Object
java.io.OutputStream
org.apache.cassandra.io.util.DataOutputStreamPlus
org.apache.cassandra.io.util.BufferedDataOutputStreamPlus
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,AutoCloseable,DataOutputPlus
- Direct Known Subclasses:
AsyncChannelOutputPlus,DataOutputBuffer,FileOutputStreamPlus,SequentialWriter
An implementation of the DataOutputStreamPlus interface using a ByteBuffer to stage writes
before flushing them to an underlying channel.
This class is completely thread unsafe.
-
Field Summary
FieldsFields inherited from class org.apache.cassandra.io.util.DataOutputStreamPlus
channel -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBufferedDataOutputStreamPlus(int size) protectedBufferedDataOutputStreamPlus(WritableByteChannel wbc, int bufferSize) BufferedDataOutputStreamPlus(WritableByteChannel channel, ByteBuffer buffer) -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBufferallocate(int size) voidclose()protected voiddoFlush(int count) voidflush()voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) voidwrite(ByteBuffer src) voidwriteBoolean(boolean v) voidwriteByte(int v) voidwriteBytes(String s) voidwriteChar(int v) voidwriteChars(String s) voidwriteDouble(double v) voidwriteFloat(float v) voidwriteInt(int v) voidwriteLong(long v) voidwriteMostSignificantBytes(long register, int bytes) An efficient way to write the typebytesof a longvoidwriteShort(int v) voidMethods inherited from class org.apache.cassandra.io.util.DataOutputStreamPlus
newDefaultChannel, retrieveTemporaryBufferMethods inherited from class java.io.OutputStream
nullOutputStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cassandra.io.util.DataOutputPlus
bytesLeftInPage, hasPosition, maxBytesInPage, paddedPosition, padToPageBoundary, position, write, writeUnsignedVInt, writeUnsignedVInt, writeUnsignedVInt32, writeVInt, writeVInt, writeVInt32
-
Field Details
-
buffer
-
-
Constructor Details
-
BufferedDataOutputStreamPlus
-
BufferedDataOutputStreamPlus
-
BufferedDataOutputStreamPlus
-
BufferedDataOutputStreamPlus
-
BufferedDataOutputStreamPlus
protected BufferedDataOutputStreamPlus(int size)
-
-
Method Details
-
allocate
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
writeBoolean
- Throws:
IOException
-
writeByte
- Throws:
IOException
-
writeMostSignificantBytes
Description copied from interface:DataOutputPlusAn efficient way to write the typebytesof a long- Parameters:
register- - the long value to be writtenbytes- - the number of bytes the register occupies. Valid values are between 1 and 8 inclusive.- Throws:
IOException
-
writeShort
- Throws:
IOException
-
writeChar
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
writeLong
- Throws:
IOException
-
writeFloat
- Throws:
IOException
-
writeDouble
- Throws:
IOException
-
writeBytes
- Throws:
IOException
-
writeChars
- Throws:
IOException
-
writeUTF
- Throws:
IOException
-
doFlush
- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
order
-