Package org.jboss.netty.buffer
Class ChannelBufferOutputStream
java.lang.Object
java.io.OutputStream
org.jboss.netty.buffer.ChannelBufferOutputStream
- All Implemented Interfaces:
Closeable,DataOutput,Flushable,AutoCloseable
An
OutputStream which writes data to a ChannelBuffer.
A write operation against this stream will occur at the writerIndex
of its underlying buffer and the writerIndex will increase during
the write operation.
This stream implements DataOutput for your convenience.
The endianness of the stream is not always big endian but depends on
the endianness of the underlying buffer.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChannelBufferprivate final intprivate final DataOutputStream -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new stream which writes data to the specifiedbuffer. -
Method Summary
Modifier and TypeMethodDescriptionbuffer()Returns the buffer where this stream is writing data.voidwrite(byte[] b) voidwrite(byte[] b, int off, int len) voidwrite(int b) 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) voidwriteShort(int v) voidintReturns the number of written bytes by this stream so far.Methods inherited from class java.io.OutputStream
close, flush
-
Field Details
-
buffer
-
startIndex
private final int startIndex -
utf8out
-
-
Constructor Details
-
ChannelBufferOutputStream
Creates a new stream which writes data to the specifiedbuffer.
-
-
Method Details
-
writtenBytes
public int writtenBytes()Returns the number of written bytes by this stream so far. -
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Overrides:
writein classOutputStream- Throws:
IOException
-
write
- Specified by:
writein interfaceDataOutput- Specified by:
writein classOutputStream- Throws:
IOException
-
writeBoolean
- Specified by:
writeBooleanin interfaceDataOutput- Throws:
IOException
-
writeByte
- Specified by:
writeBytein interfaceDataOutput- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceDataOutput- Throws:
IOException
-
writeChar
- Specified by:
writeCharin interfaceDataOutput- Throws:
IOException
-
writeChars
- Specified by:
writeCharsin interfaceDataOutput- Throws:
IOException
-
writeDouble
- Specified by:
writeDoublein interfaceDataOutput- Throws:
IOException
-
writeFloat
- Specified by:
writeFloatin interfaceDataOutput- Throws:
IOException
-
writeInt
- Specified by:
writeIntin interfaceDataOutput- Throws:
IOException
-
writeLong
- Specified by:
writeLongin interfaceDataOutput- Throws:
IOException
-
writeShort
- Specified by:
writeShortin interfaceDataOutput- Throws:
IOException
-
writeUTF
- Specified by:
writeUTFin interfaceDataOutput- Throws:
IOException
-
buffer
Returns the buffer where this stream is writing data.
-