code: public static Pair<String, String> readStringPair(DataInputStream in) {
      Pair<String, String> p = new Pair<String, String>();
      try {
        p.first = in.readUTF();
        p.second = in.readUTF();
      } catch (Exception e) {
        e.printStackTrace();
      }
      return p;
    }
docs: Read a string representation of a Pair from a DataStream.
  This might not work correctly unless the pair of objects are of type
  <code>String</code>.