private static byte[] padBytes(byte[] bytes, int count) {
    byte[] result = new byte[bytes.length + count];
    for (int i = 0; i < count; ++i) {
      // Fill the prefix bytes with deterministic data based on the actual meaningful data.
      result[i] = (byte) (bytes[i % bytes.length] * 37 + 19);
    }
    System.arraycopy(bytes, 0, result, count, bytes.length);
    return result;
  }
Pad the given byte array with the given number of bytes in the beginning. The padding bytes
deterministically depend on the passed data.
serde/src/test/org/apache/hadoop/hive/serde2/io/TestTimestampWritableV2.java