code: private static void writeField(final OutputStream out, final byte[] bytes)
        throws IOException {
      // All protocol messages are prefixed with their length in bytes, encoded
      // as a 32 bit unsigned integer.
      final ByteBuffer buffer = ByteBuffer.allocate(INT_BYTES + bytes.length);
      buffer.putInt(bytes.length);
      buffer.put(bytes);
      out.write(buffer.array());
      out.flush();
    }
docs: Write bytes to an {@link OutputStream} and prepend with four bytes indicating their length.
  @param out {@link OutputStream}
  @param bytes Array of bytes.