Kryo를 사용하여 List (사용자 정의 된 클래스의 List : List) 목록을 직렬화하려고합니다.kryo list serialization
list2D; // List<List<MyClass>> which is already produced.
Kryo k1 = new Kryo();
Output output = new Output(new FileOutputStream("filename.ser"));
k1.writeObject(output, (List<List<Myclass>>) list2D);
output.close();
지금까지 아무런 문제없이 목록을 오류없이 작성합니다. 하지만 그것을 읽으려고 할 때 :
Kryo k2 = new Kryo();
Input listRead = new Input(new FileInputStream("filename.ser"));
List<List<Myclass>> my2DList = (List<List<Myclass>>) k2.readObject(listRead, List.class);
내가이 오류 :
Exception in thread "main" com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): java.util.List
는이 문제를 어떻게 해결할 수 있습니까?
이 문제를 해결 했습니까? – expert