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
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
flush()
private static IOException
void
write
(byte[] b) Write all the bytes from the given array to the stream.void
write
(byte[] b, int off, int len) Write some of the bytes from the given array to the stream.void
write
(int b) Writes to the output stream the eight low-order bits of the argumentb
.private static EOFException
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Field Details
-
buffer
-
-
Constructor Details
-
ByteBufferOutput
Create a new instance.- Parameters:
buffer
- the buffer to write to
-
-
Method Details
-
writePastEnd
-
readOnlyBuffer
-
write
Writes to the output stream the eight low-order bits of the argumentb
. The 24 high-order bits ofb
are ignored.- Specified by:
write
in interfaceByteOutput
- Specified by:
write
in 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:
write
in interfaceByteOutput
- Overrides:
write
in 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:
write
in interfaceByteOutput
- Overrides:
write
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-