code: public byte[] toByteArray() {
          ByteBuffer buffer = ByteBuffer.allocate(OBJECT_ID_LENGTH);
          putToByteBuffer(buffer);
          return buffer.array();  // using .allocate ensures there is a backing array that can be returned
      }
docs: Convert to a byte array.  Note that the numbers are stored in big-endian order.
  
  @return the byte array