2019-04-20 03:46:59 +02:00
|
|
|
package it.cavallium.strangedb.java.database;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
2019-04-20 17:02:57 +02:00
|
|
|
import java.util.Map;
|
2019-04-20 03:46:59 +02:00
|
|
|
|
|
|
|
public interface ISerializer {
|
|
|
|
<T> Class<T> readClassBytes(byte[] input) throws IOException;
|
|
|
|
|
|
|
|
byte[] writeClassBytes(Class<?> toWrite) throws IOException;
|
|
|
|
|
|
|
|
<T> byte[] writeClassAndObjectBytes(T value) throws IOException;
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
<T> T readClassAndObjectBytes(byte[] input) throws IOException;
|
|
|
|
|
|
|
|
void registerClass(Class<?> type, int id);
|
2019-04-20 17:02:57 +02:00
|
|
|
|
|
|
|
Map<Class<?>, Integer> getRegisteredClasses();
|
2019-04-20 03:46:59 +02:00
|
|
|
}
|