Class FileSerializer

java.lang.Object
com.esotericsoftware.kryo.Serializer<File>
org.springframework.integration.codec.kryo.FileSerializer

public class FileSerializer
extends com.esotericsoftware.kryo.Serializer<File>
A custom Kryo Serializer for serializing File payloads. It serializes the file path and creates a new File instance to preserve the original path. File does not preserve the absolute otherwise as prefixLength is declared transient.
Since:
4.2
Author:
David Turanski
  • Constructor Summary

    Constructors 
    Constructor Description
    FileSerializer()  
  • Method Summary

    Modifier and Type Method Description
    File read​(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<File> type)  
    void write​(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output, File file)  

    Methods inherited from class com.esotericsoftware.kryo.Serializer

    copy, getAcceptsNull, isImmutable, setAcceptsNull, setGenerics, setImmutable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • write

      public void write​(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output, File file)
      Specified by:
      write in class com.esotericsoftware.kryo.Serializer<File>
    • read

      public File read​(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<File> type)
      Specified by:
      read in class com.esotericsoftware.kryo.Serializer<File>