public static byte[] getBytes(final Writable... ws) throws IOException {
    List<byte[]> bytes = new ArrayList<>(ws.length);
    int size = 0;
    for (Writable w : ws) {
      byte[] b = getBytes(w);
      size += b.length;
      bytes.add(b);
    }
    byte[] result = new byte[size];
    int offset = 0;
    for (byte[] b : bytes) {
      System.arraycopy(b, 0, result, offset, b.length);
      offset += b.length;
    }
    return result;
  }
Put a bunch of Writables as bytes all into the one byte array.
@param ws writable
@return The bytes of <code>w</code> gotten by running its
        {@link Writable#write(java.io.DataOutput)} method.
@throws IOException e
hbase-client/src/main/java/org/apache/hadoop/hbase/util/Writables.java