Package org.jboss.marshalling
Class ByteBufferOutput
java.lang.Object
java.io.OutputStream
org.jboss.marshalling.ByteBufferOutput
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,ByteOutput
An
OutputStream implementing ByteOutput which writes to a ByteBuffer.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()voidwrite(byte[] b) Write all the bytes from the given array to the stream.voidwrite(byte[] b, int off, int len) Write some of the bytes from the given array to the stream.voidwrite(int b) Writes to the output stream the eight low-order bits of the argumentb.Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ByteBufferOutput
Create a new instance.- Parameters:
buffer- the buffer to write to
-
-
Method Details
-
write
Writes to the output stream the eight low-order bits of the argumentb. The 24 high-order bits ofbare ignored.- Specified by:
writein interfaceByteOutput- Specified by:
writein classOutputStream- Parameters:
b- the byte to write- Throws:
IOException- if an error occurs
-
write
Write all the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Overrides:
writein classOutputStream- Parameters:
b- the byte array- Throws:
IOException- if an error occurs
-
write
Write some of the bytes from the given array to the stream.- Specified by:
writein interfaceByteOutput- Overrides:
writein classOutputStream- Parameters:
b- the byte arrayoff- the index to start writing fromlen- the number of bytes to write- Throws:
IOException- if an error occurs
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-