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


C# File.ReadBytes方法代码示例

本文整理汇总了C#中File.ReadBytes方法的典型用法代码示例。如果您正苦于以下问题:C# File.ReadBytes方法的具体用法?C# File.ReadBytes怎么用?C# File.ReadBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在File的用法示例。


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

示例1: SoundFileSubHeader

		public SoundFileSubHeader(File file)
		{
			if (file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(16);
			if (data.Length != 16) throw new ArgumentException("File is not long enough", "file");

			m_nextoffset = BitConverter.ToInt32(data, 0);
			m_length = BitConverter.ToInt32(data, 4);
			m_id = new SoundId(BitConverter.ToInt32(data, 8), BitConverter.ToInt32(data, 12));
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:11,代码来源:SoundFileSubHeader.cs

示例2: FontFileHeader

		public FontFileHeader(File file)
		{
			if (file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(24);
			if (data.Length != 24) throw new ArgumentException("File is not long enough", "file");

			m_signature = System.Text.Encoding.Default.GetString(data, 0, 11);
			m_unknown = BitConverter.ToInt32(data, 12);
			m_imageoffset = BitConverter.ToInt32(data, 16);
			m_imagesize = BitConverter.ToInt32(data, 20);
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:12,代码来源:FontFileHeader.cs

示例3: SoundFileHeader

		public SoundFileHeader(File file)
		{
			if (file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(24);
			if (data.Length != 24) throw new ArgumentException("File is not long enough", "file");

			m_signature = System.Text.Encoding.Default.GetString(data, 0, 11);
			m_version = BitConverter.ToInt32(data, 12);
			m_numberofsounds = BitConverter.ToInt32(data, 16);
			m_subheaderoffset = BitConverter.ToInt32(data, 20);
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:12,代码来源:SoundFileHeader.cs

示例4: SpriteFileSubHeader

		public SpriteFileSubHeader(File file)
		{
			if (file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(19);
			if (data.Length != 19) throw new ArgumentException("File is not long enough", "file");

			m_nextoffset = BitConverter.ToInt32(data, 0);
			m_imagesize = BitConverter.ToInt32(data, 4);
			m_axis = new Point(BitConverter.ToInt16(data, 8), BitConverter.ToInt16(data, 10));
			m_id = new SpriteId(BitConverter.ToInt16(data, 12), BitConverter.ToInt16(data, 14));
			m_sharedindex = BitConverter.ToInt16(data, 16);
			m_copylastpalette = data[18] > 0;
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:14,代码来源:SpriteFileSubHeader.cs

示例5: SpriteFileHeader

		public SpriteFileHeader(File file)
		{
			if (file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(33);
			if (data.Length != 33) throw new ArgumentException("File is not long enough", "file");

			m_signature = System.Text.Encoding.Default.GetString(data, 0, 11);
			m_version = new Drawing.SpriteFileVersion(data[12], data[13], data[14], data[15]);
			m_numberofgroups = BitConverter.ToInt32(data, 16);
			m_numberofimages = BitConverter.ToInt32(data, 20);
			m_subheaderoffset = BitConverter.ToInt32(data, 24);
			m_subheadersize = BitConverter.ToInt32(data, 28);
			m_sharedpalette = data[32] > 0;
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:15,代码来源:SpriteFileHeader.cs

示例6: PcxFileHeader

		public PcxFileHeader(File file)
		{
			if(file == null) throw new ArgumentNullException("file");

			Byte[] data = file.ReadBytes(HeaderSize);
			if (data.Length != HeaderSize) throw new ArgumentException("File is not long enough", "file");

			m_manufacturer = data[0];
			m_version = data[1];
			m_encoding = data[2];
			m_bitsperpixel = data[3];
			m_xmin = BitConverter.ToInt16(data, 4);
			m_ymin = BitConverter.ToInt16(data, 6);
			m_xmax = BitConverter.ToInt16(data, 8);
			m_ymax = BitConverter.ToInt16(data, 10);
			m_horizontalDPI = BitConverter.ToInt16(data, 12);
			m_verticalDPI = BitConverter.ToInt16(data, 14);
			m_colorplanes = data[65];
			m_bytesperline = BitConverter.ToInt16(data, 66);
			m_palettetype = BitConverter.ToInt16(data, 68);
		}
开发者ID:lodossDev,项目名称:xnamugen,代码行数:21,代码来源:PcxFileHeader.cs


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