org.springframework.integration.adapter.stream
Class ByteStreamTarget
java.lang.Object
org.springframework.integration.adapter.stream.ByteStreamTarget
- All Implemented Interfaces:
- MessageTarget
public class ByteStreamTarget
- extends java.lang.Object
- implements MessageTarget
A target that writes a byte array to an OutputStream
.
- Author:
- Mark Fisher
Field Summary |
private org.apache.commons.logging.Log |
logger
|
private java.io.BufferedOutputStream |
stream
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private final org.apache.commons.logging.Log logger
stream
private final java.io.BufferedOutputStream stream
ByteStreamTarget
public ByteStreamTarget(java.io.OutputStream stream)
ByteStreamTarget
public ByteStreamTarget(java.io.OutputStream stream,
int bufferSize)
send
public boolean send(Message message)
- Description copied from interface:
MessageTarget
- Send a
Message
to this target. May throw a RuntimeException for non-recoverable
errors. Otherwise, if the Message cannot be sent for a non-fatal reason such as timeout,
then this method will return 'false', and if the Message is sent successfully, it will
return 'true'.
- Specified by:
send
in interface MessageTarget
- Parameters:
message
- the Message to send
- Returns:
- whether the Message has been sent successfully