I am implementing B Plus Tree in java . I have a node class in which I am maintaining references to child object Nodes . Now When I serialize any node , it also serialize all the child nodes also. What I want is to serialize only that node and the references to the child nodes.I tried writing the node object as a byte stream but on de-serializing it is not working.
public class BNode implements Serializable
{
LinkedList<Float> keys;
LinkedList<BNode> childPointers;
BNode parent;
...
}
In B+ tree , the nodes are saved in disk and I have to simulate that action. Now each page is of 2 KB(say) so in my each node I am saving data of around 2044 bytes( 255 float values, and 256 node references - total 255*4 + 255*4 + some other data of 10 bytes)in a single file simulating a single node. Now if I serialize the parent node, it is serializing whole tree into single file thus defeating the whole purpose