Class ChannelBufferByteOutput
- java.lang.Object
-
- org.jboss.netty.handler.codec.marshalling.ChannelBufferByteOutput
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.AutoCloseable
,org.jboss.marshalling.ByteOutput
class ChannelBufferByteOutput extends java.lang.Object implements org.jboss.marshalling.ByteOutput
ByteOutput
implementation which writes the data to aChannelBuffer
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelBuffer
buffer
-
Constructor Summary
Constructors Constructor Description ChannelBufferByteOutput(ChannelBuffer buffer)
Create a new instance which use the givenChannelBuffer
ChannelBufferByteOutput(ChannelBufferFactory factory, int estimatedLength)
CallsChannelBufferByteOutput(ChannelBuffer)
with a dynamicChannelBuffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
flush()
ChannelBuffer
getBuffer()
Return theChannelBuffer
which contains the written contentvoid
write(byte[] bytes)
void
write(byte[] bytes, int srcIndex, int length)
void
write(int b)
-
-
-
Field Detail
-
buffer
private final ChannelBuffer buffer
-
-
Constructor Detail
-
ChannelBufferByteOutput
public ChannelBufferByteOutput(ChannelBuffer buffer)
Create a new instance which use the givenChannelBuffer
-
ChannelBufferByteOutput
public ChannelBufferByteOutput(ChannelBufferFactory factory, int estimatedLength)
CallsChannelBufferByteOutput(ChannelBuffer)
with a dynamicChannelBuffer
-
-
Method Detail
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException
- Specified by:
write
in interfaceorg.jboss.marshalling.ByteOutput
- Throws:
java.io.IOException
-
write
public void write(byte[] bytes) throws java.io.IOException
- Specified by:
write
in interfaceorg.jboss.marshalling.ByteOutput
- Throws:
java.io.IOException
-
write
public void write(byte[] bytes, int srcIndex, int length) throws java.io.IOException
- Specified by:
write
in interfaceorg.jboss.marshalling.ByteOutput
- Throws:
java.io.IOException
-
getBuffer
public ChannelBuffer getBuffer()
Return theChannelBuffer
which contains the written content
-
-