code: private void writePhysicalRecord(ByteBuffer data, Record record) {
      writeBuffer.putInt(generateCrc(data.array(), data.position(), record.getBytes(),
          record.getType()));
      writeBuffer.putShort((short) record.getBytes());
      writeBuffer.put(record.getType().value());
      int oldLimit = data.limit();
      data.limit(data.position() + record.getBytes());
      writeBuffer.put(data);
      data.limit(oldLimit);
    }
docs: This method creates a record inside of a {@link ByteBuffer}
  
  @param data The data to output.
  @param record A {@link Record} object that describes
  which data to write.