code: private static String readString(DataInput reader) throws IOException {
  		int blocks = reader.readInt();
  		String result;
  		if (blocks == 0) {
  			result = null;
  		} else if (blocks < 0) {
  			throw new DeserializerException("Wrong 'null' indicator for a string", "0", Integer.toString(blocks));
  		} else {
  			StringBuilder sb = new StringBuilder();
  			for (int i=0; i<blocks; i++) {
  				sb.append(reader.readUTF());
  			}
  			result = sb.toString();
  		}
  		return result;
  	}
docs: /*
  Deserialize string. Make sure <code>null</code> is handled properly.