org.springframework.integration.adapter.stream
Class ByteStreamSource

java.lang.Object
  extended by org.springframework.integration.adapter.stream.ByteStreamSource
All Implemented Interfaces:
MessageSource<byte[]>, PollableSource<byte[]>

public class ByteStreamSource
extends java.lang.Object
implements PollableSource<byte[]>

A pollable source for receiving bytes from an InputStream.

Author:
Mark Fisher

Field Summary
private  int bytesPerMessage
           
private  boolean shouldTruncate
           
private  java.io.BufferedInputStream stream
           
private  java.lang.Object streamMonitor
           
 
Constructor Summary
ByteStreamSource(java.io.InputStream stream)
           
ByteStreamSource(java.io.InputStream stream, int bufferSize)
           
 
Method Summary
 Message<byte[]> receive()
          Retrieve a message from this source or null if no message is available.
 void setBytesPerMessage(int bytesPerMessage)
           
 void setShouldTruncate(boolean shouldTruncate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

private java.io.BufferedInputStream stream

streamMonitor

private java.lang.Object streamMonitor

bytesPerMessage

private int bytesPerMessage

shouldTruncate

private boolean shouldTruncate
Constructor Detail

ByteStreamSource

public ByteStreamSource(java.io.InputStream stream)

ByteStreamSource

public ByteStreamSource(java.io.InputStream stream,
                        int bufferSize)
Method Detail

setBytesPerMessage

public void setBytesPerMessage(int bytesPerMessage)

setShouldTruncate

public void setShouldTruncate(boolean shouldTruncate)

receive

public Message<byte[]> receive()
Description copied from interface: PollableSource
Retrieve a message from this source or null if no message is available.

Specified by:
receive in interface PollableSource<byte[]>