Class AbstractByteArraySerializer

java.lang.Object
org.springframework.integration.ip.tcp.serializer.AbstractByteArraySerializer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.ApplicationEventPublisherAware, org.springframework.core.serializer.Deserializer<byte[]>, org.springframework.core.serializer.Serializer<byte[]>
Direct Known Subclasses:
AbstractPooledBufferByteArraySerializer, ByteArrayLengthHeaderSerializer

public abstract class AbstractByteArraySerializer
extends java.lang.Object
implements org.springframework.core.serializer.Serializer<byte[]>, org.springframework.core.serializer.Deserializer<byte[]>, org.springframework.context.ApplicationEventPublisherAware
Base class for (de)serializers that provide a mechanism to reconstruct a byte array from an arbitrary stream.
Since:
2.0
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static int DEFAULT_MAX_MESSAGE_SIZE
    The default maximum message size when deserializing.
    protected org.springframework.core.log.LogAccessor logger  
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractByteArraySerializer()  
  • Method Summary

    Modifier and Type Method Description
    protected void checkClosure​(int bite)  
    int getMaxMessageSize()
    The maximum supported message size for this serializer.
    protected void publishEvent​(java.lang.Exception cause, byte[] buffer, int offset)  
    void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)  
    void setMaxMessageSize​(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, wait

    Methods inherited from interface org.springframework.core.serializer.Deserializer

    deserialize, deserializeFromByteArray

    Methods inherited from interface org.springframework.core.serializer.Serializer

    serialize, serializeToByteArray
  • Field Details

  • Constructor Details

  • 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

      public void setApplicationEventPublisher​(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
      Specified by:
      setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAware
    • checkClosure

      protected void checkClosure​(int bite) throws java.io.IOException
      Throws:
      java.io.IOException
    • publishEvent

      protected void publishEvent​(java.lang.Exception cause, byte[] buffer, int offset)