Class ByteArraySerializer

  • All Implemented Interfaces:
    Serializer

    public class ByteArraySerializer
    extends Object
    This Serializer (de)serializes byte arrays (just returns the byte array unchanged/uncopied).
    • Constructor Detail

      • ByteArraySerializer

        public ByteArraySerializer()
    • Method Detail

      • matchedToByArray

        protected byte[] matchedToByArray​(byte[] o)
      • matchedFromByteArray

        protected byte[] matchedFromByteArray​(byte[] bytes,
                                              Class<byte[]> type)
      • fromByteArray

        public <T> T fromByteArray​(byte[] bytes,
                                   Class<T> type)
                            throws IOException
        Description copied from interface: Serializer
        Produces an object of type T from an array of bytes.
        Specified by:
        fromByteArray in interface Serializer
        Throws:
        IOException - if serialization to byte array fails