CSJ2K.j2k.codestream.writer.HeaderEncoder.writeTo C# (CSharp) Method

writeTo() public method

Writes the header to the specified BinaryDataOutput.
public writeTo ( BinaryDataOutput out_Renamed ) : void
out_Renamed BinaryDataOutput
return void
        public virtual void writeTo(BinaryDataOutput out_Renamed)
        {
            int i, len;
            byte[] buf;

            buf = Buffer;
            len = Length;

            for (i = 0; i < len; i++)
            {
                out_Renamed.writeByte(buf[i]);
            }
        }

Same methods

HeaderEncoder::writeTo ( System out_Renamed ) : void

Usage Example

		/// <summary> Writes the header data in the codestream and actualize ndata with the
		/// header length. The header is either a MainHeaderEncoder or a
		/// TileHeaderEncoder.
		/// 
		/// </summary>
		/// <param name="he">The current header encoder.
		/// 
		/// </param>
		/// <exception cref="IOException">If an I/O error occurs while writing the data.
		/// 
		/// </exception>
		public override void  commitBitstreamHeader(HeaderEncoder he)
		{
			// Actualize ndata
			ndata += he.Length;
			he.writeTo(out_Renamed); // Write the header
			// Reset packet index used for SOP markers
			packetIdx = 0;
			
			// Deal with ROI information
			lenLastNoROI += he.Length;
		}