CSJ2K.j2k.io.BEBufferedRandomAccessFile.writeInt C# (CSharp) Метод

writeInt() публичный Метод

Writes the int value of v (i.e., the 32 bits) to the output. Prior to writing, the output should be realigned at the byte level.
If an I/O error ocurred. /// ///
public writeInt ( int v ) : void
v int The value to write to the output /// ///
Результат void
        public override void writeInt(int v)
        {
            write(SupportClass.URShift(v, 24));
            write(SupportClass.URShift(v, 16));
            write(SupportClass.URShift(v, 8));
            write(v);
        }

Usage Example

Пример #1
0
		/// <summary> This method reads the codestream and writes the file format wrapper and
		/// the codestream to the same file
		/// 
		/// </summary>
		/// <returns> The number of bytes increases because of the file format
		/// 
		/// </returns>
		/// <exception cref="java.io.IOException">If an I/O error ocurred.
		/// 
		/// </exception>
		public virtual int writeFileFormat()
		{
			byte[] codestream;
			
			try
			{
				// Read and buffer the codestream
				fi = new BEBufferedRandomAccessFile(filename, "rw+");
				codestream = new byte[clength];
				fi.readFully(codestream, 0, clength);
				
				// Write the JP2_SINATURE_BOX
				fi.seek(0);
				fi.writeInt(0x0000000c);
				fi.writeInt(CSJ2K.j2k.fileformat.FileFormatBoxes.JP2_SIGNATURE_BOX);
				fi.writeInt(0x0d0a870a);
				
				// Write File Type box
				writeFileTypeBox();
				
				// Write JP2 Header box
				writeJP2HeaderBox();
				
				// Write the Codestream box 
				writeContiguousCodeStreamBox(codestream);
				
				fi.close();
			}
			catch (System.Exception e)
			{
				throw new System.ApplicationException("Error while writing JP2 file format(2): " + e.Message + "\n" + e.StackTrace);
			}
			if (bpcVaries)
				return 12 + FTB_LENGTH + 8 + IHB_LENGTH + CSB_LENGTH + BPC_LENGTH + nc + 8;
			else
				return 12 + FTB_LENGTH + 8 + IHB_LENGTH + CSB_LENGTH + 8;
		}