HCOLL-211 Add BytesMarshaller and improve handling of invalid sizes.

This commit is contained in:
Peter Lawrey
2014-11-30 14:18:45 +02:00
parent 50a337af0d
commit 6fdfc9184c
2 changed files with 6 additions and 5 deletions
@@ -1952,7 +1952,6 @@ class StatelessServerConnector<K, V> {
}
private void writeSizeAndFlags(long locationOfSize, boolean isException, Bytes out) {
long currentPosition = out.position();
final long size = out.position() - locationOfSize;
out.writeInt(locationOfSize, (int) size); // size
out.writeBoolean(locationOfSize + SIZE_OF_SIZE, isException); // isException
@@ -1964,7 +1963,7 @@ class StatelessServerConnector<K, V> {
private Map<K, V> readEntries(Bytes reader) {
final long numberOfEntries = reader.readStopBit();
final HashMap<K, V> result = new HashMap<K, V>();
final Map<K, V> result = new HashMap<K, V>();
ThreadLocalCopies copies = keyReaderWithSize.getCopies(null);
BytesReader<K> keyReader = keyReaderWithSize.readerForLoop(copies);