public static void writeByteArray(final DataOutput out, final byte[] b) throws IOException {
    if (b == null) {
      WritableUtils.writeVInt(out, 0);
    } else {
      writeByteArray(out, b, 0, b.length);
    }
  }
Write byte-array with a WritableableUtils.vint prefix.
@param out output stream to be written to
@param b   array to write
@throws IOException e
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java