Skip to content

Commit

Permalink
Use BinaryWire instead of TextWire because of predictable whitespace …
Browse files Browse the repository at this point in the history
…and bytes position after read/write
  • Loading branch information
leventov committed Nov 27, 2015
1 parent 0a4ccaf commit 5d4161e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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;
Expand Down Expand Up @@ -1384,7 +1384,7 @@ ChronicleMap<K, V> createWithFile(
headerBuffer.flip();
Bytes<ByteBuffer> headerBytes = Bytes.wrapForRead(headerBuffer);
headerBytes.readLimit(headerBuffer.limit());
Wire wire = new TextWire(headerBytes);
Wire wire = new BinaryWire(headerBytes);
VanillaChronicleMap<K, V, ?> map = wire.getValueIn().typedMarshallable();
map.initTransientsFromBuilder(this);
initTransientsFromReplication(map, singleHashReplication, channel);
Expand Down Expand Up @@ -1423,7 +1423,7 @@ ChronicleMap<K, V> createWithFile(
FileChannel fileChannel = raf.getChannel();
ByteBuffer headerBuffer = ByteBuffer.allocate(MAX_BOOTSTRAPPING_HEADER_SIZE);
Bytes<ByteBuffer> headerBytes = Bytes.wrapForWrite(headerBuffer);
Wire wire = new TextWire(headerBytes);
Wire wire = new BinaryWire(headerBytes);
wire.getValueOut().typedMarshallable(map);

int headerSize = (int) headerBytes.writePosition();
Expand Down

0 comments on commit 5d4161e

Please sign in to comment.