Class AbstractByteArraySerializer
java.lang.Object
org.springframework.integration.ip.tcp.serializer.AbstractByteArraySerializer
- All Implemented Interfaces:
Aware,ApplicationEventPublisherAware,Deserializer<byte[]>,Serializer<byte[]>
- Direct Known Subclasses:
AbstractPooledBufferByteArraySerializer,ByteArrayLengthHeaderSerializer
public abstract class AbstractByteArraySerializer
extends Object
implements Serializer<byte[]>, Deserializer<byte[]>, ApplicationEventPublisherAware
Base class for (de)serializers that provide a mechanism to
reconstruct a byte array from an arbitrary stream.
- Since:
- 2.0
- Author:
- Gary Russell, Artme Bilan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default maximum message size when deserializing.protected final LogAccessor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckClosure(int bite) intThe maximum supported message size for this serializer.protected voidpublishEvent(Exception cause, byte[] buffer, int offset) voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) voidsetMaxMessageSize(int maxMessageSize) The maximum supported message size for this serializer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.core.serializer.Deserializer
deserialize, deserializeFromByteArrayMethods inherited from interface org.springframework.core.serializer.Serializer
serialize, serializeToByteArray
-
Field Details
-
DEFAULT_MAX_MESSAGE_SIZE
public static final int DEFAULT_MAX_MESSAGE_SIZEThe default maximum message size when deserializing.- Since:
- 5.1.3
- See Also:
-
logger
-
-
Constructor Details
-
AbstractByteArraySerializer
public AbstractByteArraySerializer()
-
-
Method Details
-
getMaxMessageSize
public int getMaxMessageSize()The maximum supported message size for this serializer. Default 2048.- Returns:
- The max message size.
-
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize) The maximum supported message size for this serializer. Default 2048.- Parameters:
maxMessageSize- The max message size.
-
setApplicationEventPublisher
- Specified by:
setApplicationEventPublisherin interfaceApplicationEventPublisherAware
-
checkClosure
- Throws:
IOException
-
publishEvent
-