Package org.serviceconnector.net
Class MessageEncoderDecoderAdapter
java.lang.Object
org.serviceconnector.net.MessageEncoderDecoderAdapter
- All Implemented Interfaces:
IEncoderDecoder
- Direct Known Subclasses:
DefaultMessageEncoderDecoder,KeepAliveMessageEncoderDecoder,LargeMessageEncoderDecoder
The Class MessageEncoderDecoderAdapter.
- Author:
- JTraber
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]compressBody(byte[] bodyBuffer, int bodyOffset, int bodyLength) Compress body.decode(InputStream is) Decode input stream.protected StringBuilderwriteHeader(Map<String, String> metaMap) Write header.protected voidwriteHeadLine(SCMPVersion scmpVersion, BufferedWriter bw, SCMPHeaderKey headerKey, int messageSize, int headerSize) Write head line.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.serviceconnector.net.IEncoderDecoder
encode
-
Constructor Details
-
MessageEncoderDecoderAdapter
public MessageEncoderDecoderAdapter()
-
-
Method Details
-
decode
Decode input stream.- Specified by:
decodein interfaceIEncoderDecoder- Parameters:
is- the is to decode- Returns:
- the object decoded
- Throws:
Exception- the exception
-
writeHeadLine
protected void writeHeadLine(SCMPVersion scmpVersion, BufferedWriter bw, SCMPHeaderKey headerKey, int messageSize, int headerSize) throws IOException Write head line.- Parameters:
scmpVersion- the SCMP versionbw- the bufferedWriterheaderKey- the header keymessageSize- the message sizeheaderSize- the header size- Throws:
IOException- Signals that an I/O exception has occurred.
-
writeHeader
Write header.- Parameters:
metaMap- the meta map- Returns:
- the string builder
-
compressBody
Compress body.- Parameters:
bodyBuffer- the body bufferbodyOffset- the body offsetbodyLength- the body length- Returns:
- the byte[]
- Throws:
IOException- Signals that an I/O exception has occurred.
-