void parseWritable(final DataInputStream in) throws IOException {
    // First clear the map.
    // Otherwise we will just accumulate entries every time this method is called.
    this.map.clear();
    // Read the number of entries in the map
    int entries = in.readInt();
    // Then read each key/value pair
    for (int i = 0; i < entries; i++) {
      byte[] key = Bytes.readByteArray(in);
      // We used to read a byte that encoded the class type.
      // Read and ignore it because it is always byte [] in hfile
      in.readByte();
      byte[] value = Bytes.readByteArray(in);
      this.map.put(key, value);
    }
  }
Now parse the old Writable format. It was a list of Map entries. Each map entry was a key and a
value of a byte []. The old map format had a byte before each entry that held a code which was
short for the key or value type. We know it was a byte [] so in below we just read and dump it.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileInfo.java