From 5d4161eb26af21cca7905bb456f6978aa6c1890f Mon Sep 17 00:00:00 2001 From: leventov Date: Fri, 27 Nov 2015 16:29:44 +0300 Subject: [PATCH] Use BinaryWire instead of TextWire because of predictable whitespace and bytes position after read/write --- .../java/net/openhft/chronicle/map/ChronicleMapBuilder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index b71296882..707ccd97d 100755 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -33,7 +33,7 @@ import net.openhft.chronicle.map.replication.MapRemoteOperations; import net.openhft.chronicle.set.ChronicleSetBuilder; import net.openhft.chronicle.threads.NamedThreadFactory; import net.openhft.chronicle.values.ValueModel; -import net.openhft.chronicle.wire.TextWire; +import net.openhft.chronicle.wire.BinaryWire; import net.openhft.chronicle.wire.Wire; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; @@ -1384,7 +1384,7 @@ public final class ChronicleMapBuilder implements headerBuffer.flip(); Bytes headerBytes = Bytes.wrapForRead(headerBuffer); headerBytes.readLimit(headerBuffer.limit()); - Wire wire = new TextWire(headerBytes); + Wire wire = new BinaryWire(headerBytes); VanillaChronicleMap map = wire.getValueIn().typedMarshallable(); map.initTransientsFromBuilder(this); initTransientsFromReplication(map, singleHashReplication, channel); @@ -1423,7 +1423,7 @@ public final class ChronicleMapBuilder implements FileChannel fileChannel = raf.getChannel(); ByteBuffer headerBuffer = ByteBuffer.allocate(MAX_BOOTSTRAPPING_HEADER_SIZE); Bytes headerBytes = Bytes.wrapForWrite(headerBuffer); - Wire wire = new TextWire(headerBytes); + Wire wire = new BinaryWire(headerBytes); wire.getValueOut().typedMarshallable(map); int headerSize = (int) headerBytes.writePosition();