org.springframework.integration.ip.tcp.converter
Class ByteArrayCrLfConverter
java.lang.Object
org.springframework.integration.ip.tcp.converter.AbstractByteArrayStreamingConverter
org.springframework.integration.ip.tcp.converter.ByteArrayCrLfConverter
- All Implemented Interfaces:
- org.springframework.commons.serializer.InputStreamingConverter<byte[]>, org.springframework.commons.serializer.OutputStreamingConverter<byte[]>
public class ByteArrayCrLfConverter
- extends AbstractByteArrayStreamingConverter
Converts data in an InputStream to a byte[]; data is terminated by \r\n
(not included in resulting byte[]).
Writes a byte[] to an OutputStream and adds \r\n.
- Since:
- 2.0
- Author:
- Gary Russell
Method Summary |
void |
convert(byte[] bytes,
OutputStream outputStream)
Writes the byte[] to the stream and appends \r\n. |
byte[] |
convert(InputStream inputStream)
Converts the data in the inputstream to a byte[]. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ByteArrayCrLfConverter
public ByteArrayCrLfConverter()
convert
public byte[] convert(InputStream inputStream)
throws IOException
- Converts the data in the inputstream to a byte[]. Data must be terminated
by CRLF (\r\n). Throws a
SoftEndOfStreamException
if the stream
is closed immediately after the \r\n (i.e. no data is in the process of
being read).
- Throws:
IOException
convert
public void convert(byte[] bytes,
OutputStream outputStream)
throws IOException
- Writes the byte[] to the stream and appends \r\n.
- Throws:
IOException
Copyright © 2010. All Rights Reserved.