mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Read/Write ChronicleMap's boostrapping header with Wire
This commit is contained in:
@@ -18,11 +18,12 @@ package net.openhft.chronicle.map.fromdocs;
|
||||
|
||||
import net.openhft.chronicle.bytes.Bytes;
|
||||
import net.openhft.chronicle.hash.serialization.SizedReader;
|
||||
import net.openhft.chronicle.hash.serialization.impl.EnumMarshallable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
enum LongPairArrayReader implements SizedReader<LongPair[]> {
|
||||
enum LongPairArrayReader implements SizedReader<LongPair[]>, EnumMarshallable<LongPairArrayReader> {
|
||||
INSTANCE;
|
||||
|
||||
@NotNull
|
||||
@@ -50,4 +51,9 @@ enum LongPairArrayReader implements SizedReader<LongPair[]> {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LongPairArrayReader readResolve() {
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,10 @@ package net.openhft.chronicle.map.fromdocs;
|
||||
|
||||
import net.openhft.chronicle.bytes.Bytes;
|
||||
import net.openhft.chronicle.hash.serialization.SizedWriter;
|
||||
import net.openhft.chronicle.hash.serialization.impl.EnumMarshallable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
enum LongPairArrayWriter implements SizedWriter<LongPair[]> {
|
||||
enum LongPairArrayWriter implements SizedWriter<LongPair[]>, EnumMarshallable<LongPairArrayWriter> {
|
||||
INSTANCE;
|
||||
|
||||
@Override
|
||||
@@ -35,4 +36,9 @@ enum LongPairArrayWriter implements SizedWriter<LongPair[]> {
|
||||
out.writeLong(pair.second);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LongPairArrayWriter readResolve() {
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user