public static String readString(final DataInput in) throws IOException {

		if (in.readBoolean()) {
			final int length = in.readInt();
			if (length < 0) {
				throw new IOException("length of StringRecord is " + length);
			}

			final byte[] bytes = new byte[length];
			in.readFully(bytes, 0, length);
			return decode(bytes);
		}

		return null;
	}
public static String readString ( final DataInput in ) throws IOException { if ( in . readBoolean ( ) ) { final int length = in . readInt ( ) ; if ( length < 0 ) { throw new IOException ( "length of StringRecord is " + length ) ; } final byte [ ] bytes = new byte [ length ] ; in . readFully ( bytes , 0 , length ) ; return decode ( bytes ) ; } return null ; }
Read a UTF8 encoded string from in