本文整理汇总了C#中System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# __BinaryParser.ReadByte方法的具体用法?C# __BinaryParser.ReadByte怎么用?C# __BinaryParser.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Runtime.Serialization.Formatters.Binary.__BinaryParser
的用法示例。
在下文中一共展示了__BinaryParser.ReadByte方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read(__BinaryParser input)
{
switch (this.binaryHeaderEnum)
{
case BinaryHeaderEnum.ArraySinglePrimitive:
this.objectId = input.ReadInt32();
this.lengthA = new int[] { input.ReadInt32() };
this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
this.rank = 1;
this.lowerBoundA = new int[this.rank];
this.binaryTypeEnum = BinaryTypeEnum.Primitive;
this.typeInformation = (InternalPrimitiveTypeE) input.ReadByte();
return;
case BinaryHeaderEnum.ArraySingleObject:
this.objectId = input.ReadInt32();
this.lengthA = new int[] { input.ReadInt32() };
this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
this.rank = 1;
this.lowerBoundA = new int[this.rank];
this.binaryTypeEnum = BinaryTypeEnum.Object;
this.typeInformation = null;
return;
case BinaryHeaderEnum.ArraySingleString:
this.objectId = input.ReadInt32();
this.lengthA = new int[] { input.ReadInt32() };
this.binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
this.rank = 1;
this.lowerBoundA = new int[this.rank];
this.binaryTypeEnum = BinaryTypeEnum.String;
this.typeInformation = null;
return;
}
this.objectId = input.ReadInt32();
this.binaryArrayTypeEnum = (BinaryArrayTypeEnum) input.ReadByte();
this.rank = input.ReadInt32();
this.lengthA = new int[this.rank];
this.lowerBoundA = new int[this.rank];
for (int i = 0; i < this.rank; i++)
{
this.lengthA[i] = input.ReadInt32();
}
if (((this.binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) || (this.binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset)) || (this.binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
{
for (int j = 0; j < this.rank; j++)
{
this.lowerBoundA[j] = input.ReadInt32();
}
}
this.binaryTypeEnum = (BinaryTypeEnum) input.ReadByte();
this.typeInformation = BinaryConverter.ReadTypeInfo(this.binaryTypeEnum, input, out this.assemId);
}
示例2: Read
public void Read(__BinaryParser input)
{
this.objectId = input.ReadInt32();
this.name = input.ReadString();
this.numMembers = input.ReadInt32();
this.memberNames = new string[this.numMembers];
this.binaryTypeEnumA = new BinaryTypeEnum[this.numMembers];
this.typeInformationA = new object[this.numMembers];
this.memberAssemIds = new int[this.numMembers];
for (int i = 0; i < this.numMembers; i++)
{
this.memberNames[i] = input.ReadString();
}
for (int j = 0; j < this.numMembers; j++)
{
this.binaryTypeEnumA[j] = (BinaryTypeEnum) input.ReadByte();
}
for (int k = 0; k < this.numMembers; k++)
{
if ((this.binaryTypeEnumA[k] != BinaryTypeEnum.ObjectUrt) && (this.binaryTypeEnumA[k] != BinaryTypeEnum.ObjectUser))
{
this.typeInformationA[k] = BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[k], input, out this.memberAssemIds[k]);
}
else
{
BinaryConverter.ReadTypeInfo(this.binaryTypeEnumA[k], input, out this.memberAssemIds[k]);
}
}
if (this.binaryHeaderEnum == BinaryHeaderEnum.ObjectWithMapTypedAssemId)
{
this.assemId = input.ReadInt32();
}
}
示例3: ReadWithCode
internal static object ReadWithCode(__BinaryParser input)
{
InternalPrimitiveTypeE code = (InternalPrimitiveTypeE) input.ReadByte();
switch (code)
{
case InternalPrimitiveTypeE.Null:
return null;
case InternalPrimitiveTypeE.String:
return input.ReadString();
}
return input.ReadValue(code);
}
示例4: Read
public void Read(__BinaryParser input, BinaryHeaderEnum binaryHeaderEnum)
{
switch (binaryHeaderEnum)
{
case BinaryHeaderEnum.ObjectNull:
this.nullCount = 1;
return;
case BinaryHeaderEnum.MessageEnd:
case BinaryHeaderEnum.Assembly:
break;
case BinaryHeaderEnum.ObjectNullMultiple256:
this.nullCount = input.ReadByte();
return;
case BinaryHeaderEnum.ObjectNullMultiple:
this.nullCount = input.ReadInt32();
break;
default:
return;
}
}
示例5: ReadTypeInfo
internal static object ReadTypeInfo(BinaryTypeEnum binaryTypeEnum, __BinaryParser input, out int assemId)
{
object obj2 = null;
int num = 0;
switch (binaryTypeEnum)
{
case BinaryTypeEnum.Primitive:
case BinaryTypeEnum.PrimitiveArray:
obj2 = (InternalPrimitiveTypeE) input.ReadByte();
break;
case BinaryTypeEnum.String:
case BinaryTypeEnum.Object:
case BinaryTypeEnum.ObjectArray:
case BinaryTypeEnum.StringArray:
break;
case BinaryTypeEnum.ObjectUrt:
obj2 = input.ReadString();
break;
case BinaryTypeEnum.ObjectUser:
obj2 = input.ReadString();
num = input.ReadInt32();
break;
default:
throw new SerializationException(Environment.GetResourceString("Serialization_TypeRead", new object[] { binaryTypeEnum.ToString() }));
}
assemId = num;
return obj2;
}
示例6: Read
public void Read(__BinaryParser input, BinaryHeaderEnum binaryHeaderEnum)
{
//binaryHeaderEnum = input.ReadByte(); already read
switch (binaryHeaderEnum)
{
case BinaryHeaderEnum.ObjectNull:
nullCount = 1;
break;
case BinaryHeaderEnum.ObjectNullMultiple256:
nullCount = input.ReadByte();
//Console.WriteLine("Read nullCount "+nullCount);
break;
case BinaryHeaderEnum.ObjectNullMultiple:
nullCount = input.ReadInt32();
//Console.WriteLine("Read nullCount "+nullCount);
break;
}
}
示例7: ReadWithCode
internal static Object ReadWithCode(__BinaryParser input)
{
InternalPrimitiveTypeE code = (InternalPrimitiveTypeE)input.ReadByte();
if (code == InternalPrimitiveTypeE.Null)
return null;
else if (code == InternalPrimitiveTypeE.String)
return input.ReadString();
else
return input.ReadValue(code);
}
示例8: ReadTypeInfo
// Reads the type information from the wire
internal static Object ReadTypeInfo(BinaryTypeEnum binaryTypeEnum, __BinaryParser input, out int assemId)
{
SerTrace.Log( "BinaryConverter", "ReadTypeInfo Entry ",((Enum)binaryTypeEnum).ToString());
Object var = null;
int readAssemId = 0;
switch (binaryTypeEnum)
{
case BinaryTypeEnum.Primitive:
case BinaryTypeEnum.PrimitiveArray:
var = (InternalPrimitiveTypeE)input.ReadByte();
break;
case BinaryTypeEnum.String:
case BinaryTypeEnum.Object:
case BinaryTypeEnum.StringArray:
case BinaryTypeEnum.ObjectArray:
break;
case BinaryTypeEnum.ObjectUrt:
var = input.ReadString();
break;
case BinaryTypeEnum.ObjectUser:
var = input.ReadString();
readAssemId = input.ReadInt32();
break;
default:
throw new SerializationException(Environment.GetResourceString("Serialization_TypeRead",((Enum)binaryTypeEnum).ToString()));
}
SerTrace.Log( "BinaryConverter", "ReadTypeInfo Exit ",var," assemId ",readAssemId);
assemId = readAssemId;
return var;
}
示例9: Read
public void Read(__BinaryParser input)
{
// binaryHeaderEnum has already been read
binaryHeaderEnum = (BinaryHeaderEnum)input.ReadByte();
topId = input.ReadInt32();
headerId = input.ReadInt32();
majorVersion = input.ReadInt32();
minorVersion = input.ReadInt32();
if (majorVersion > binaryFormatterMajorVersion)
throw new SerializationException(String.Format(Environment.GetResourceString("Serialization_Version"),binaryFormatterMajorVersion+"."+binaryFormatterMinorVersion, majorVersion+"."+minorVersion));
}
示例10: Read
public void Read(__BinaryParser input)
{
this.primitiveTypeEnum = (InternalPrimitiveTypeE) input.ReadByte();
this.value = input.ReadValue(this.primitiveTypeEnum);
}