org.activemq.streams
Class JMSInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.activemq.streams.JMSInputStream

public class JMSInputStream
extends InputStream

An inputStream that reads data from a MessageConsumer

Version:
$Revision: 1.1.1.1 $

Field Summary
protected  ByteArray[] arrays
           
protected  int clen
           
 
Constructor Summary
JMSInputStream(MessageConsumer consumer)
          Construct an input stream to read from a JMS Consumer
 
Method Summary
 int available()
          Return the number of bytes available for reading.
 void close()
          close the stream and the MessageConsumer
 void mark(int readlimit)
          Set the stream's mark to the current position.
 boolean markSupported()
           
 int read()
          Read the next byte from this stream.
 int read(byte[] b)
          Read data from this input stream into the given byte array starting at offset 0 for b.length bytes.
 int read(byte[] b, int off, int len)
          Read data from this input stream into the given byte array starting at offset 'off' for 'len' bytes.
 void reset()
          Returns the stream to the position of the previous mark().
 long skip(long length)
          Skip n bytes in this stream; returns the number of bytes actually skipped (which may be less than the number requested).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arrays

protected ByteArray[] arrays

clen

protected int clen
Constructor Detail

JMSInputStream

public JMSInputStream(MessageConsumer consumer)
Construct an input stream to read from a JMS Consumer

Parameters:
consumer -
Method Detail

read

public int read()
         throws IOException
Read the next byte from this stream.

Returns:
the next byte
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Read data from this input stream into the given byte array starting at offset 0 for b.length bytes. Returns the actual number of bytes read;

Parameters:
b -
Returns:
the number of bytes read
Throws:
IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Read data from this input stream into the given byte array starting at offset 'off' for 'len' bytes. Returns the actual number of bytes read.

Parameters:
b - buffer to read data into
off - offset into b
len - the maximum length
Returns:
the number of bytes actually read
Throws:
IOException

skip

public long skip(long length)
          throws IOException
Skip n bytes in this stream; returns the number of bytes actually skipped (which may be less than the number requested).

Parameters:
length - the number of bytes to skip
Returns:
the number of bytes actually skipped
Throws:
IOException

available

public int available()
              throws IOException
Return the number of bytes available for reading.

Returns:
the number of bytes available
Throws:
IOException

close

public void close()
close the stream and the MessageConsumer


markSupported

public boolean markSupported()
Returns:
true

reset

public void reset()
           throws IOException
Returns the stream to the position of the previous mark().

Throws:
IOException

mark

public void mark(int readlimit)
Set the stream's mark to the current position.

Parameters:
readlimit -


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