本文整理汇总了C#中IBinaryReader类的典型用法代码示例。如果您正苦于以下问题:C# IBinaryReader类的具体用法?C# IBinaryReader怎么用?C# IBinaryReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IBinaryReader类属于命名空间,在下文中一共展示了IBinaryReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Decompress
protected static byte[] Decompress(byte[] decrypted, IBinaryReader reader, byte[] key, int keyMod) {
int destIndex = 0;
while (reader.Position < reader.Length) {
if (destIndex >= decrypted.Length)
break;
byte flags = reader.ReadByte();
for (int mask = 1; mask != 0x100; mask <<= 1) {
if (reader.Position >= reader.Length)
break;
if (destIndex >= decrypted.Length)
break;
if ((flags & mask) != 0) {
int displ = (int)reader.Read7BitEncodedUInt32();
int size = (int)reader.Read7BitEncodedUInt32();
Copy(decrypted, destIndex - displ, decrypted, destIndex, size);
destIndex += size;
}
else {
byte b = reader.ReadByte();
if (key != null)
b ^= key[destIndex % keyMod];
decrypted[destIndex++] = b;
}
}
}
return decrypted;
}
示例2: ReadBinary
/** <inheritDoc /> */
public void ReadBinary(IBinaryReader reader)
{
StreetNumber = reader.ReadInt("streetNum");
FlatNumber = reader.ReadInt("flatNum");
City = reader.ReadString("city");
Street = reader.ReadString("street");
}
示例3: ReadBinary
/** <inheritDoc /> */
public void ReadBinary(IBinaryReader reader)
{
Byte = reader.ReadByte("Byte");
ByteArray = reader.ReadByteArray("ByteArray");
Char = reader.ReadChar("Char");
CharArray = reader.ReadCharArray("CharArray");
Short = reader.ReadShort("Short");
ShortArray = reader.ReadShortArray("ShortArray");
Int = reader.ReadInt("Int");
IntArray = reader.ReadIntArray("IntArray");
Long = reader.ReadLong("Long");
LongArray = reader.ReadLongArray("LongArray");
Boolean = reader.ReadBoolean("Boolean");
BooleanArray = reader.ReadBooleanArray("BooleanArray");
Float = reader.ReadFloat("Float");
FloatArray = reader.ReadFloatArray("FloatArray");
Double = reader.ReadDouble("Double");
DoubleArray = reader.ReadDoubleArray("DoubleArray");
Decimal = reader.ReadDecimal("Decimal");
DecimalArray = reader.ReadDecimalArray("DecimalArray");
Date = reader.ReadTimestamp("Date");
DateArray = reader.ReadTimestampArray("DateArray");
String = reader.ReadString("String");
StringArray = reader.ReadStringArray("StringArray");
Guid = reader.ReadObject<Guid>("Guid");
GuidArray = reader.ReadGuidArray("GuidArray");
}
示例4: ReadHeader
static bool ReadHeader(IBinaryReader reader, out ushort flags, out uint codeSize) {
byte b = reader.ReadByte();
switch (b & 7) {
case 2:
case 6:
flags = 2;
codeSize = (uint)(b >> 2);
return true;
case 3:
flags = (ushort)((reader.ReadByte() << 8) | b);
uint headerSize = (byte)(flags >> 12);
ushort maxStack = reader.ReadUInt16();
codeSize = reader.ReadUInt32();
uint localVarSigTok = reader.ReadUInt32();
reader.Position += -12 + headerSize * 4;
if (headerSize < 3)
flags &= 0xFFF7;
return true;
default:
flags = 0;
codeSize = 0;
return false;
}
}
示例5: Deserialize
internal void Deserialize(IBinaryReader reader, int count)
{
for (int i = 0; i < count; i++)
{
_excerpts.Add(reader.ReadString());
}
}
示例6: BinaryPropertyDeserializer
///<summary>
///</summary>
///<param name = "reader"></param>
public BinaryPropertyDeserializer(IBinaryReader reader)
{
if (reader == null) {
throw new ArgumentNullException("reader");
}
_reader = reader;
}
示例7: ComputeFuncJob
/// <summary>
/// Initializes a new instance of the <see cref="ComputeFuncJob"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public ComputeFuncJob(IBinaryReader reader)
{
var reader0 = (BinaryReader) reader.GetRawReader();
_clo = reader0.ReadObject<IComputeFunc>();
_arg = reader0.ReadObject<object>();
}
示例8: ContinuousQueryFilterHolder
/// <summary>
/// Initializes a new instance of the <see cref="ContinuousQueryFilterHolder"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public ContinuousQueryFilterHolder(IBinaryReader reader)
{
var rawReader = (BinaryReader) reader.GetRawReader();
_filter = rawReader.ReadObject<object>();
_keepBinary = rawReader.ReadBoolean();
}
示例9: Deserialize
internal void Deserialize(IBinaryReader reader, MatchParseContext context)
{
_docId = (context.LongIdentifiers) ? reader.ReadInt64() : reader.ReadInt32();
_weight = reader.ReadInt32();
AttributesValues.Deserialize(reader, context);
}
示例10: ParseMethodBody
public static MethodBodyHeader ParseMethodBody(IBinaryReader reader, out byte[] code, out byte[] extraSections) {
try {
return ParseMethodBody2(reader, out code, out extraSections);
}
catch (IOException) {
throw new InvalidMethodBody();
}
}
示例11: OperationDataMapper
public OperationDataMapper(IXmlReader xmlReader, IBinaryReader binaryReader, ISpatialRecordMapper spatialRecordMapper, ISectionMapper sectionMapper, IUniqueIdMapper uniqueIdMapper)
{
_spatialRecordMapper = spatialRecordMapper;
_sectionMapper = sectionMapper;
_uniqueIdMapper = uniqueIdMapper;
_xmlReader = xmlReader;
_binaryReader = binaryReader;
}
示例12: Read
/// <summary>
/// Reads the column
/// </summary>
/// <param name="reader">A reader positioned on this column</param>
/// <returns>The column value</returns>
public uint Read(IBinaryReader reader) {
switch (size) {
case 1: return reader.ReadByte();
case 2: return reader.ReadUInt16();
case 4: return reader.ReadUInt32();
default: throw new InvalidOperationException("Invalid column size");
}
}
示例13: Deserialize
internal void Deserialize(IBinaryReader reader)
{
FlushTag = reader.ReadInt32();
if (FlushTag < 0)
{
throw new SphinxException(String.Format(Messages.Exception_CouldNotFlushIndexAttributeValues, FlushTag));
}
}
示例14: SerializableObjectHolder
/// <summary>
/// Initializes a new instance of the <see cref="SerializableObjectHolder"/> class.
/// </summary>
/// <param name="reader">The reader.</param>
public SerializableObjectHolder(IBinaryReader reader)
{
Debug.Assert(reader != null);
var reader0 = (BinaryReader) reader.GetRawReader();
_item = new BinaryFormatter().Deserialize(new BinaryStreamAdapter(reader0.Stream), null);
}
示例15: ResourceReader
ResourceReader(ModuleDef module, IBinaryReader reader, CreateResourceDataDelegate createResourceDataDelegate) {
this.reader = reader;
this.resourceDataCreator = new ResourceDataCreator(module);
this.createResourceDataDelegate = createResourceDataDelegate;
var stream = reader as IImageStream;
this.baseFileOffset = stream == null ? 0 : (long)stream.FileOffset;
}