org.activemq.streams
Class JMSOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.activemq.streams.JMSOutputStream

public class JMSOutputStream
extends OutputStream

OutputStream that writes on to JMS via the supplied JMS MessageProducer

Version:
$Revision: 1.1.1.1 $

Constructor Summary
JMSOutputStream(MessageProducer producer)
          Creates a new output stream to write data using the supplied JMS MessageProducer
JMSOutputStream(MessageProducer producer, int size)
          Creates a new output stream to write data using the supplied JMS MessageProducer
 
Method Summary
protected  void checkClosed()
          Checks that the stream has not been closed
 void close()
          close this stream
 void flush()
          flush the data to the output stream This doesn't call flush on the underlying outputstream, because Tcp is particularly efficent at doing this itself ....
 void write(byte[] b, int off, int len)
          write a byte array to the stream
 void write(int b)
          write a byte on to the stream
 
Methods inherited from class java.io.OutputStream
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMSOutputStream

public JMSOutputStream(MessageProducer producer)
Creates a new output stream to write data using the supplied JMS MessageProducer

Parameters:
producer -

JMSOutputStream

public JMSOutputStream(MessageProducer producer,
                       int size)
Creates a new output stream to write data using the supplied JMS MessageProducer

Parameters:
producer -
size - the buffer size.
Throws:
IllegalArgumentException - if size <= 0.
Method Detail

write

public void write(int b)
           throws IOException
write a byte on to the stream

Parameters:
b - - byte to write
Throws:
IOException

write

public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
write a byte array to the stream

Parameters:
b - the byte buffer
off - the offset into the buffer
len - the length of data to write
Throws:
IOException

flush

public void flush()
           throws IOException
flush the data to the output stream This doesn't call flush on the underlying outputstream, because Tcp is particularly efficent at doing this itself ....

Throws:
IOException

close

public void close()
           throws IOException
close this stream

Throws:
IOException

checkClosed

protected void checkClosed()
                    throws IOException
Checks that the stream has not been closed

Throws:
IOException


Copyright © 2004-2007 Protique, Ltd.. All Rights Reserved.