@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }
@Override public void writePayload(ListNode<Key, Value> node, DataOutput os) throws IOException { os.writeLong(node.next); short count = (short) node.entries.size(); // cast may truncate // value... if (count != node.entries.size()) { throw new IOException("short over flow, too many entries in list: " + node.entries.size()); } os.writeShort(count); KeyValueEntry<Key, Value> entry = node.entries.getHead(); while (entry != null) { keyMarshaller.writePayload((Key) entry.getKey(), os); valueMarshaller.writePayload((Value) entry.getValue(), os); entry = entry.getNext(); } }