JBoss Marshalling 1.3.0.CR9

org.jboss.marshalling
Class ByteBufferOutput

java.lang.Object
  extended by java.io.OutputStream
      extended by org.jboss.marshalling.ByteBufferOutput
All Implemented Interfaces:
Closeable, Flushable, ByteOutput

public class ByteBufferOutput
extends OutputStream
implements ByteOutput

An OutputStream implementing ByteOutput which writes to a ByteBuffer.


Constructor Summary
ByteBufferOutput(ByteBuffer buffer)
          Create a new instance.
 
Method Summary
 void close()
          
 void flush()
          
 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 argument b.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferOutput

public ByteBufferOutput(ByteBuffer buffer)
Create a new instance.

Parameters:
buffer - the buffer to write to
Method Detail

write

public void write(int b)
           throws IOException
Writes to the output stream the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.

Specified by:
write in interface ByteOutput
Specified by:
write in class OutputStream
Parameters:
b - the byte to write
Throws:
IOException - if an error occurs

write

public void write(byte[] b)
           throws IOException
Write all the bytes from the given array to the stream.

Specified by:
write in interface ByteOutput
Overrides:
write in class OutputStream
Parameters:
b - the byte array
Throws:
IOException - if an error occurs

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
Write some of the bytes from the given array to the stream.

Specified by:
write in interface ByteOutput
Overrides:
write in class OutputStream
Parameters:
b - the byte array
off - the index to start writing from
len - the number of bytes to write
Throws:
IOException - if an error occurs

close

public void close()
           throws IOException

Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

public void flush()
           throws IOException

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

JBoss Marshalling 1.3.0.CR9

Copyright © 2011 JBoss, a division of Red Hat, Inc.