code: public static byte[] toByteArray(final ByteString bs) {
      return bs == null || bs.isEmpty() ? null : bs.toByteArray();
    }
docs: Converts ByteString to byte array.
  @param bs ByteString
  @return byte array or null if not present