FlacLibSharp.MetadataBlockHeader.WriteHeaderData C# (CSharp) Method

WriteHeaderData() public method

Will write the data representing this header (as it is stored in the FLAC file) to the given stream.
public WriteHeaderData ( Stream targetStream ) : void
targetStream Stream The stream where the data will be written to.
return void
        public void WriteHeaderData(Stream targetStream)
        {
            byte data = this.isLastMetaDataBlock ? (byte)128 : (byte)0; // The 128 because the last metadata flag is the most significant bit set to 1 ...
            data += (byte)(this.typeID & 0x7F); // We make sure to chop off the last bit

            targetStream.WriteByte(data);

            // 24-bit metaDataBlockLength
            targetStream.Write(BinaryDataHelper.GetBytes((UInt64)this.metaDataBlockLength, 3), 0, 3);
        }