public static byte[] readByteArray(DataInput in) throws IOException {

    int length = readArrayLength(in);
    if (length == -1) {
      return null;
    } else {
      byte[] array = new byte[length];
      in.readFully(array, 0, length);
      return array;
    }
  }
Reads an instance of <code>String</code> from a <code>DataInput</code>. The return value may be
<code>null</code>.

@throws IOException A problem occurs while reading from <code>in</code>

@see #writeString
geode-serialization/src/main/java/org/apache/geode/internal/serialization/StaticSerialization.java