当前位置: 首页>>代码示例>>C#>>正文


C# Endian类代码示例

本文整理汇总了C#中Endian的典型用法代码示例。如果您正苦于以下问题:C# Endian类的具体用法?C# Endian怎么用?C# Endian使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Endian类属于命名空间,在下文中一共展示了Endian类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ByteBuffer

 public ByteBuffer(byte[] data, Endian endian)
 {
     _data = data;
     _endian = endian;
     _encoding = Encoding.ASCII;
     _specificCharacterSet = null;
 }
开发者ID:nhannd,项目名称:Xian,代码行数:7,代码来源:ByteBuffer.cs

示例2: ExportNamedConstants

			public void ExportNamedConstants( GpuNamedConstants pConsts, string filename, Endian endianMode )
			{
				using ( var f = new FileStream( filename, FileMode.CreateNew, FileAccess.Write ) )
				{
					ExportNamedConstants( pConsts, f, endianMode );
				}
			}
开发者ID:ryan-bunker,项目名称:axiom3d,代码行数:7,代码来源:GpuProgramParameters.GpuNamedConstantSerializer.cs

示例3: NeedConvert

 static private bool NeedConvert(Endian endian)
 {
     if (endian == Endian.LittleEndian)
         return !isLittleEndian;
     else
         return isLittleEndian;
 }
开发者ID:superkaka,项目名称:mycsharp,代码行数:7,代码来源:NetUtils.cs

示例4: Create

 public static BinaryReader Create(Stream s, Endian e)
 {
     if (BitConverter.IsLittleEndian)
     {
         if (Endian.Little == e)
         {
             return new BinaryReader(s);
         }
         else
         {
             return new EndianBinaryReader(s, e);
         }
     }
     else
     {
         if (Endian.Big == e)
         {
             return new BinaryReader(s);
         }
         else
         {
             return new EndianBinaryReader(s, e);
         }
     }
 }
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:25,代码来源:Endian.cs

示例5: writeBytes

	/**
	 * Writes any number of bytes into a byte array, at a given position.
	 * This is an aux function used when creating the WAV data.
	 */
	public static void writeBytes(byte[] __bytes, ref int __position, byte[] __newBytes, Endian __endian) {
		// Writes __newBytes to __bytes at position __position, increasing the position depending on the length of __newBytes
		for (int i = 0; i < __newBytes.Length; i++) {
			__bytes[__position] = __newBytes[__endian == Endian.BIG_ENDIAN ? i : __newBytes.Length - i - 1];
			__position++;
		}
	}
开发者ID:OJ3D,项目名称:unity-tidbits,代码行数:11,代码来源:ByteUtils.cs

示例6: DataStream

        /// <summary>
        /// Initializes a new instance of the DataStream class.  
        /// This will store all PDU information for either an InputStream or OutputStream.
        /// </summary>
        public DataStream()
        {
            // Test the machine to determine to see what it supports.
            this.endianType = (BitConverter.IsLittleEndian ? Endian.Little : Endian.Big);

            // create a new MemoryStream
            this.Stream = new MemoryStream();
        }
开发者ID:mcgredonps,项目名称:Unity_DIS,代码行数:12,代码来源:DataStream.cs

示例7: WriteValueF32

 public static void WriteValueF32(this Stream stream, Single value, Endian endian)
 {
     byte[] data = ShouldSwap(endian) == true
                       ? BitConverter.GetBytes(BitConverter.ToInt32(BitConverter.GetBytes(value), 0).Swap())
                       : BitConverter.GetBytes(value);
     Debug.Assert(data.Length == 4);
     stream.WriteBytes(data);
 }
开发者ID:Juvidoh,项目名称:me3-lazarus,代码行数:8,代码来源:F32.cs

示例8: LuaCompilerConfig

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="endianness">Big or little endian</param>
        /// <param name="sizeofInt">Size of int in bytes</param>
        /// <param name="sizeofSizeT">Size of size_t in bytes</param>
        /// <param name="sizeofLuaNumber">Size of lua_Number in bytes</param>
        /// <param name="stripDebugInfo">Whether to strip debug info or not</param>
	    public LuaCompilerConfig(Endian endianness, int sizeofInt, int sizeofSizeT, int sizeofLuaNumber, bool stripDebugInfo)
	    {
            Endianness = endianness;
            SizeOfInt = sizeofInt;
            SizeOfSizeT = sizeofSizeT;
            SizeOfLuaNumber = sizeofLuaNumber;
            StripDebugInfo = stripDebugInfo;
	    }
开发者ID:arsaccol,项目名称:SLED,代码行数:16,代码来源:ILuaCompiler.cs

示例9: FileReference

		internal FileReference(DicomStreamOpener streamOpener, long offset, long length, Endian endian, DicomVr vr)
		{
			StreamOpener = streamOpener;
			Offset = offset;
			_length = length;
			Endian = endian;
			Vr = vr;
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:8,代码来源:FileReference.cs

示例10: WriteValueF64

 public static void WriteValueF64(this Stream stream, Double value, Endian endian)
 {
     byte[] data = ShouldSwap(endian) == true
                       ? BitConverter.GetBytes(BitConverter.DoubleToInt64Bits(value).Swap())
                       : BitConverter.GetBytes(value);
     Debug.Assert(data.Length == 8);
     stream.WriteBytes(data);
 }
开发者ID:XxRaPiDK3LLERxX,项目名称:nucleuscoop,代码行数:8,代码来源:F64.cs

示例11: EndianBinaryReader

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="data">Data to encapsulate</param>
        /// <param name="endian"><see cref="Endian"/> to use when reading the data.</param>
        public EndianBinaryReader(byte[] data, Endian endian)
            : base(new MemoryStream(data))
        {
            if (data == null)
                throw new ArgumentNullException("data");

            this.CurrentEndian = endian;
        }
开发者ID:lioncash,项目名称:GameMusicInfoLib,代码行数:13,代码来源:EndianBinaryReader.cs

示例12: FileReference

		internal FileReference(string file, long offset, long length, Endian endian, DicomVr vr)
		{
			_filename = file;
			_offset = offset;
			_length = length;
			_endian = endian;
			_vr = vr;
		}
开发者ID:UIKit0,项目名称:ClearCanvas,代码行数:8,代码来源:FileReference.cs

示例13: ByteBuffer

		private ByteBuffer(byte[] data, Endian endian, bool highCapacityMode = false)
		{
			_data = data;
			_endian = endian;
			Encoding = Encoding.ASCII;
			SpecificCharacterSet = null;
			_highCapacityMode = highCapacityMode;
		}
开发者ID:kevinpig,项目名称:MyRepository,代码行数:8,代码来源:ByteBuffer.cs

示例14: ReadValueGuid

 public static Guid ReadValueGuid(this Stream stream, Endian endian)
 {
     var a = stream.ReadValueS32(endian);
     var b = stream.ReadValueS16(endian);
     var c = stream.ReadValueS16(endian);
     var d = stream.ReadBytes(8);
     return new Guid(a, b, c, d);
 }
开发者ID:XxRaPiDK3LLERxX,项目名称:nucleuscoop,代码行数:8,代码来源:Guid.cs

示例15: MPEntryValue

 public MPEntryValue(byte[] bytes, int startIndex, Endian endian)
 {
     ImageAttr = (uint)BitConverterEx.ToInt32(bytes, startIndex + 0, endian);
     ImageSize = (uint)BitConverterEx.ToInt32(bytes, startIndex + 4, endian);
     ImageDataOffset = (uint)BitConverterEx.ToInt32(bytes, startIndex + 8, endian);
     DependentImage1 = (ushort)BitConverterEx.ToInt16(bytes, startIndex + 12, endian);
     DependentImage2 = (ushort)BitConverterEx.ToInt16(bytes, startIndex + 14, endian);
 }
开发者ID:shimat,项目名称:mpo2jpg,代码行数:8,代码来源:MPEntryValue.cs


注:本文中的Endian类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。