@SuppressWarnings("unchecked")
  public TreeMap readMap() throws IOException {
    int length = readMapHeader();
    TreeMap result = new TreeMap();
    for (int i = 0; i < length; i++) {
      Object key = read();
      Object value = read();
      result.put(key, value);
    }
    return result;
  }
Reads the map following a <code>Type.MAP</code> code.

@return the obtained map
@throws IOException
contrib/src/java/org/apache/hadoop/hive/contrib/util/typedbytes/TypedBytesInput.java