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, Artem Bilan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input, Class<? extends 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, setImmutable

    Methods inherited from class java.lang.Object

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

    • FileSerializer

      public FileSerializer()
  • 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<? extends File> type)
      Specified by:
      read in class com.esotericsoftware.kryo.Serializer<File>