Update BTree.java

Added writing for metadata for BTree