+ public static byte[] toBytes(final long length) {
+ final byte[] l = String.valueOf(length).getBytes(Charsets.US_ASCII);
+ final byte[] h = new byte[HEADER_START.length + l.length + 1];
+ System.arraycopy(HEADER_START, 0, h, 0, HEADER_START.length);
+ System.arraycopy(l, 0, h, HEADER_START.length, l.length);
+ System.arraycopy(new byte[] { HEADER_END }, 0, h, HEADER_START.length + l.length, 1);
+ return h;