diff --git a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java index 7f428e329..0206ce009 100755 --- a/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/VanillaChronicleMap.java @@ -320,6 +320,32 @@ class VanillaChronicleMap, @SuppressWarnings("unchecked") Segment[] ss = (Segment[]) Array.newInstance(segmentType(), actualSegments); this.segments = ss; + + + keyBytesToInstance = + new InstanceOrBytesToInstance() { + @Override + public K toInstance(@NotNull ThreadLocalCopies copies, Bytes keyBytes, long size) { + assertNotNull(copies); + BytesReader keyReader = keyReaderProvider.get(copies, originalKeyReader); + return keyReader.read(keyBytes, size); + } + }; + valueBytesToInstance = + new InstanceOrBytesToInstance() { + @Override + public V toInstance(@NotNull ThreadLocalCopies copies, Bytes valueBytes, long size) { + return readValue(copies, valueBytes, null, size); + } + }; + outputValueBytesToInstance = + new InstanceOrBytesToInstance() { + @Override + public V toInstance(@NotNull ThreadLocalCopies copies, Bytes outputBytes, long size) { + outputBytes.position(outputBytes.position() - size); + return readValue(copies, outputBytes, null, size); + } + }; } Class segmentType() {