code: private void writeHeader() throws IOException {
      final ByteBuffer headerBuffer = ByteBuffer.allocate(LZ4_MAX_HEADER_LENGTH).order(ByteOrder.LITTLE_ENDIAN);
      headerBuffer.putInt(MAGIC);
      headerBuffer.put(frameInfo.getFLG().toByte());
      headerBuffer.put(frameInfo.getBD().toByte());
      if (frameInfo.isEnabled(FLG.Bits.CONTENT_SIZE)) {
        headerBuffer.putLong(knownSize);
      }
      // compute checksum on all descriptor fields
      final int hash = (checksum.hash(headerBuffer.array(), INTEGER_BYTES, headerBuffer.position() - INTEGER_BYTES, 0) >> 8) & 0xFF;
      headerBuffer.put((byte) hash);
      // write out frame descriptor
      out.write(headerBuffer.array(), 0, headerBuffer.position());
    }
docs: Writes the magic number and frame descriptor to the underlying {@link OutputStream}.
  
  @throws IOException