@Override public void traverse(BNode<Integer, Long> node) { byte[] b = bNodeToBytes(node); long pos = byteDynamicArray.size() + writePos; byteDynamicArray.add(b); node.setPosition(pos); }
/** * 将BNode存储到byte数组中 * * @param node */ private void storeToByteArray(BNode<Integer, Long> node) { node.setPosition(writePos + byteDynamicArray.size()); byte[] b = bNodeToBytes(node); byteDynamicArray.add(b); if (!updated) { updated = true; } }