本文整理匯總了C#中System.IO.BinaryReader.Skip方法的典型用法代碼示例。如果您正苦於以下問題:C# BinaryReader.Skip方法的具體用法?C# BinaryReader.Skip怎麽用?C# BinaryReader.Skip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IO.BinaryReader
的用法示例。
在下文中一共展示了BinaryReader.Skip方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Read
public void Read(BinaryReader reader)
{
Type = reader.ReadByte();
Subtype = reader.ReadByte();
reader.Skip(2);
Modifier = reader.ReadInt16();
reader.Skip(2);
unknown1 = reader.ReadInt32();
Rarity = reader.ReadByte();
Material = reader.ReadByte();
Flags = reader.ReadByte();
reader.Skip(1);
Level = reader.ReadInt16();
reader.Skip(2);
for (int i = 0; i < AttributeCount; ++i)
{
ItemAttribute attribute = new ItemAttribute();
attribute.Read(reader);
Attributes.Add(attribute);
}
// AttributesUsed is calculated on write
reader.Skip(4);
// TODO Ignore recipes for now
if (Type == 2)
Subtype = 0;
}
示例2: Read
public override void Read(Stream input)
{
BinaryReader reader = new BinaryReader(input, Encoding.Default, true);
uint magicNumber1 = reader.ReadUInt32(); // foxf
ushort magicNumber2 = reader.ReadUInt16(); // pk
FpkType = (FpkType) reader.ReadByte(); // ' ' or 'd'
byte magicNumber3 = reader.ReadByte(); // w
ushort magicNumber4 = reader.ReadUInt16(); // in
uint fileSize = reader.ReadUInt32();
reader.Skip(18);
uint magicNumber5 = reader.ReadUInt32(); // 2
uint fileCount = reader.ReadUInt32();
uint referenceCount = reader.ReadUInt32();
reader.Skip(4);
for (int i = 0; i < fileCount; i++)
{
Entries.Add(FpkEntry.ReadFpkEntry(input));
}
for (int i = 0; i < referenceCount; i++)
{
References.Add(FpkReference.ReadFpkReference(input));
}
}
示例3: DownloadHandler
public DownloadHandler(BinaryReader stream, BackgroundWorkerEx worker)
{
worker?.ReportProgress(0, "Loading \"download\"...");
stream.Skip(2); // DL
byte b1 = stream.ReadByte();
byte b2 = stream.ReadByte();
byte b3 = stream.ReadByte();
int numFiles = stream.ReadInt32BE();
short numTags = stream.ReadInt16BE();
int numMaskBytes = (numFiles + 7) / 8;
for (int i = 0; i < numFiles; i++)
{
MD5Hash key = stream.Read<MD5Hash>();
//byte[] unk = stream.ReadBytes(0xA);
stream.Skip(0xA);
//var entry = new DownloadEntry() { Index = i, Unk = unk };
var entry = new DownloadEntry() { Index = i };
DownloadData.Add(key, entry);
worker?.ReportProgress((int)((i + 1) / (float)numFiles * 100));
}
for (int i = 0; i < numTags; i++)
{
DownloadTag tag = new DownloadTag();
string name = stream.ReadCString();
tag.Type = stream.ReadInt16BE();
byte[] bits = stream.ReadBytes(numMaskBytes);
for (int j = 0; j < numMaskBytes; j++)
bits[j] = (byte)((bits[j] * 0x0202020202 & 0x010884422010) % 1023);
tag.Bits = new BitArray(bits);
Tags.Add(name, tag);
}
}
示例4: Read
public void Read(BinaryReader reader)
{
OffsetX = reader.ReadByte();
OffsetY = reader.ReadByte();
OffsetZ = reader.ReadByte();
Material = reader.ReadByte();
Level = reader.ReadInt16();
reader.Skip(2);
}
示例5: Read
public void Read(Stream inputStream)
{
BinaryReader reader = new BinaryReader(inputStream, Encoding.Default, true);
string magicNumber = reader.ReadString(4);
short endianess = reader.ReadInt16();
byte entryCount = reader.ReadByte();
reader.Skip(1);
short headerSize = reader.ReadInt16();
inputStream.AlignRead(16);
List<FfntEntryHeader> ffntEntryHeaders = new List<FfntEntryHeader>();
for (int i = 0; i < entryCount; i++)
{
ffntEntryHeaders.Add(FfntEntryHeader.ReadFfntEntryHeader(inputStream));
}
foreach (var header in ffntEntryHeaders)
{
Entries.Add(header.ReadData(inputStream));
}
}
示例6: DownloadHandler
public DownloadHandler(BinaryReader stream)
{
stream.Skip(2); // DL
byte b1 = stream.ReadByte();
byte b2 = stream.ReadByte();
byte b3 = stream.ReadByte();
int numFiles = stream.ReadInt32BE();
short numTags = stream.ReadInt16BE();
int numMaskBytes = numFiles / 8 + (numFiles % 8 > 0 ? 1 : 0);
for (int i = 0; i < numFiles; i++)
{
byte[] key = stream.ReadBytes(0x10);
byte[] unk = stream.ReadBytes(0xA);
DownloadEntry entry = new DownloadEntry() { Index = i, Unk = unk };
DownloadData.Add(key, entry);
}
for (int i = 0; i < numTags; i++)
{
DownloadTag tag = new DownloadTag();
string name = stream.ReadCString();
tag.Type = stream.ReadInt16BE();
byte[] bits = stream.ReadBytes(numMaskBytes);
for (int j = 0; j < numMaskBytes; j++)
bits[j] = (byte)((bits[j] * 0x0202020202 & 0x010884422010) % 1023);
tag.Bits = new BitArray(bits);
Tags.Add(name, tag);
}
}
示例7: Read
private void Read(Stream input)
{
BinaryReader reader = new BinaryReader(input, Encoding.Default, true);
StringOffset = reader.ReadInt32();
reader.Skip(4);
StringLength = reader.ReadInt32();
reader.Skip(4);
long endPosition = input.Position;
input.Position = StringOffset;
Value = reader.ReadString(StringLength);
input.Position = endPosition;
}
示例8: Read
public void Read(BinaryReader reader)
{
Type = reader.ReadByte();
Subtype = reader.ReadByte();
reader.Skip(2);
Modifier = reader.ReadInt16();
reader.Skip(2);
RecipeType = reader.ReadByte();
reader.Skip(3);
Rarity = reader.ReadByte();
Material = reader.ReadByte();
Flags = (ItemFlags)reader.ReadByte();
reader.Skip(1);
Level = reader.ReadInt16();
reader.Skip(2);
for (int i = 0; i < AttributeCount; ++i)
{
ItemAttribute attribute = new ItemAttribute();
attribute.Read(reader);
Attributes.Add(attribute);
}
// AttributesUsed is calculated on write
reader.Skip(4);
ActualModifier = Modifier;
}
示例9: EncodingHandler
public EncodingHandler(BinaryReader stream)
{
stream.Skip(2); // EN
byte b1 = stream.ReadByte();
byte checksumSizeA = stream.ReadByte();
byte checksumSizeB = stream.ReadByte();
ushort flagsA = stream.ReadUInt16();
ushort flagsB = stream.ReadUInt16();
int numEntriesA = stream.ReadInt32BE();
int numEntriesB = stream.ReadInt32BE();
byte b4 = stream.ReadByte();
int stringBlockSize = stream.ReadInt32BE();
stream.Skip(stringBlockSize);
stream.Skip(numEntriesA * 32);
long chunkStart = stream.BaseStream.Position;
for (int i = 0; i < numEntriesA; ++i)
{
ushort keysCount;
while ((keysCount = stream.ReadUInt16()) != 0)
{
int fileSize = stream.ReadInt32BE();
MD5Hash hash = stream.Read<MD5Hash>();
EncodingEntry entry = new EncodingEntry();
entry.Size = fileSize;
// how do we handle multiple keys?
for (int ki = 0; ki < keysCount; ++ki)
{
MD5Hash key = stream.Read<MD5Hash>();
// use first key for now
if (ki == 0)
entry.Key = key;
else
Log.Write("Multiple encoding keys for MD5 hash {0} -> {1}", hash.ToHexString(), key.ToHexString());
}
EncodingData.Add(hash, entry);
}
// each chunk is 4096 bytes, and zero padding at the end
long remaining = CHUNK_SIZE - ((stream.BaseStream.Position - chunkStart) % CHUNK_SIZE);
if (remaining > 0)
stream.BaseStream.Position += remaining;
}
for (int i = 0; i < numEntriesB; ++i)
{
byte[] firstKey = stream.ReadBytes(16);
byte[] blockHash = stream.ReadBytes(16);
}
long chunkStart2 = stream.BaseStream.Position;
for (int i = 0; i < numEntriesB; ++i)
{
byte[] key = stream.ReadBytes(16);
int stringIndex = stream.ReadInt32BE();
byte unk1 = stream.ReadByte();
int fileSize = stream.ReadInt32BE();
// each chunk is 4096 bytes, and zero padding at the end
long remaining = CHUNK_SIZE - ((stream.BaseStream.Position - chunkStart2) % CHUNK_SIZE);
if (remaining > 0)
stream.BaseStream.Position += remaining;
}
}
示例10: Read
public static DdsFileHeader Read(Stream inputStream)
{
DdsFileHeader result = new DdsFileHeader();
BinaryReader reader = new BinaryReader(inputStream, Encoding.Default, true);
result.Size = reader.ReadInt32();
result.Flags = (DdsFileHeaderFlags) reader.ReadInt32();
result.Height = reader.ReadInt32();
result.Width = reader.ReadInt32();
result.PitchOrLinearSize = reader.ReadInt32();
result.Depth = reader.ReadInt32();
result.MipMapCount = reader.ReadInt32();
// int Reserved1[11];
reader.Skip(44);
result.PixelFormat = DdsPixelFormat.ReadDdsPixelFormat(inputStream);
result.Caps = (DdsSurfaceFlags) reader.ReadInt32();
result.Caps2 = (DdsCubemap) reader.ReadInt32();
result.Caps3 = reader.ReadInt32();
result.Caps4 = reader.ReadInt32();
// int Reserved2;
reader.Skip(4);
return result;
}
示例11: Read
private void Read(Stream input)
{
BinaryReader reader = new BinaryReader(input, Encoding.Default, true);
uint magicNumber1 = reader.ReadUInt32();
uint magicNumber2 = reader.ReadUInt32();
int entityCount = reader.ReadInt32();
int stringTableOffset = reader.ReadInt32();
int offsetData = reader.ReadInt32();
reader.Skip(12);
for (int i = 0; i < entityCount; i++)
{
FoxEntity entity = FoxEntity.ReadFoxEntity(input);
_entities.Add(entity);
}
FoxStringLookupLiteral stringLookupLiteral;
while ((stringLookupLiteral = FoxStringLookupLiteral.ReadFoxStringLookupLiteral(input)) != null)
{
_stringLookupLiterals.Add(stringLookupLiteral);
}
input.AlignRead(16);
reader.Skip(2);
string eof = reader.ReadString(3);
input.AlignRead(16);
}
示例12: Process
public override void Process(ClientConnection client, byte[] data)
{
using (var stream = new MemoryStream(data))
using (var reader = new BinaryReader(stream))
{
int type = reader.ReadInt32();
reader.ReadInt16();
float start_x = reader.ReadSingle();
float start_y = reader.ReadSingle();
float start_z = reader.ReadSingle();
reader.ReadInt64();//zeros
float x1 = reader.ReadSingle();
float y1 = reader.ReadSingle();
float z1 = reader.ReadSingle();
float cosinus = reader.ReadSingle();
float unk2 = reader.ReadSingle();
float sinus = reader.ReadSingle();
float unk4 = reader.ReadSingle();
float x2 = reader.ReadSingle();
float y2 = reader.ReadSingle();
float z2 = reader.ReadSingle();
float x3 = reader.ReadSingle();
float y3 = reader.ReadSingle();
float z3 = reader.ReadSingle();
float x4 = reader.ReadSingle();
float y4 = reader.ReadSingle();
float z4 = reader.ReadSingle();
float x5 = reader.ReadSingle();
float y5 = reader.ReadSingle();
float z5 = reader.ReadSingle();
float x6 = reader.ReadSingle();
float y6 = reader.ReadSingle();
float z6 = reader.ReadSingle();
float x7 = reader.ReadSingle();
float y7 = reader.ReadSingle();
float z7 = reader.ReadSingle();
float x8 = reader.ReadSingle();
float y8 = reader.ReadSingle();
float z8 = reader.ReadSingle();
float x9 = reader.ReadSingle();
float y9 = reader.ReadSingle();
float z9 = reader.ReadSingle();
reader.Skip(94); //zeros
var cHeading = Math.Acos(cosinus);
var sHeading = Math.Asin(sinus);
var heading = start_x * cosinus - start_y * sinus;
var movementAcion = new MovementAction(
new Position(new Vector3(start_x, start_y, start_z))
{
Cosinus = cosinus, Sinus = sinus, Heading = (short) heading
}, new Position(new Vector3(0,0,0)), (short) heading, 120, 1);
Core.Act(s => s.WorldProcessor.ObjectMoved(client.ActivePlayer, movementAcion));
//Log.Debug("\n----------------\n" +
// $"Type {type} cHeading {cHeading} sHeading {sHeading} calculated heading {heading}\n" +
// $"Cos {cosinus} Sin {sinus}\n" +
// $"x-{start_x} y-{start_y} z-{start_z}\n" +
// $"x-{x1} y-{y1} z-{z1}\n" +
// $"x-{x2} y-{y2} z-{z2}\n" +
// $"x-{x3} y-{y3} z-{z3}\n" +
// $"x-{x4} y-{y4} z-{z4}\n" +
// $"x-{x5} y-{y5} z-{z5}\n" +
// $"x-{x6} y-{y6} z-{z6}\n" +
// $"x-{x7} y-{y7} z-{z7}\n" +
// $"x-{x8} y-{y8} z-{z8}\n" +
// $"x-{x9} y-{y9} z-{z9}\n" +
// $"----------------");
}
}
示例13: Area
public Area(string path)
{
this.Props = new List<Prop>();
this.Events = new List<Event>();
using (var fs = new FileStream(path, FileMode.Open))
using (var br = new BinaryReader(fs))
{
Version = br.ReadInt16();
if (Version < 202)
throw new Exception("Invalid file version.");
br.Skip(0x02); // Unk
br.Skip(0x04); // Unk
AreaId = br.ReadInt16();
var regionId = br.ReadInt16(); // Unk
Server = br.ReadUnicodeString();
Name = br.ReadUnicodeString();
br.Skip(0x10); // Unk
var eventCount = br.ReadInt32();
var propCount = br.ReadInt32();
br.Skip(0x14); // Unk
X1 = br.ReadSingle();
br.Skip(0x04); // Unk
Y1 = br.ReadSingle();
br.Skip(0x0C); // Unk
X2 = br.ReadSingle();
br.Skip(0x04); // Unk
Y2 = br.ReadSingle();
br.Skip(0x0C); // Unk
if (Version == 203)
br.Skip(0x04); // Unk
var ver = br.ReadInt16();
br.Skip(0x02); // Unk
var propCountCheck = br.ReadInt32();
if (ver < 202 || propCount != propCountCheck)
throw new Exception("Reading error.");
for (int i = 0; i < propCount; ++i)
{
var prop = new Prop();
prop.ClassId = br.ReadInt32();
prop.PropId = br.ReadInt64();
prop.Name = br.ReadUnicodeString();
prop.X = br.ReadSingle();
prop.Y = br.ReadSingle();
br.Skip(0x04); // Unk (Z?)
var shapeCount = br.ReadByte();
br.Skip(0x04); // Unk
for (int j = 0; j < shapeCount; ++j)
{
var dirX1 = br.ReadSingle();
var dirX2 = br.ReadSingle();
var dirY1 = br.ReadSingle();
var dirY2 = br.ReadSingle();
var lenX = br.ReadSingle();
var lenY = br.ReadSingle();
br.Skip(0x04); // Unk
var posX = br.ReadSingle();
var posY = br.ReadSingle();
br.Skip(0x10); // Unk
prop.Shape.AddRange(GetShapeLines(dirX1, dirX2, dirY1, dirY2, lenX, lenY, posX, posY));
}
prop.Solid = (br.ReadByte() != 0);
br.ReadByte(); // Unk
prop.Scale = br.ReadSingle();
prop.Direction = br.ReadSingle();
br.Skip(0x40); // Unk
br.ReadUnicodeString(); // title
br.ReadUnicodeString(); // state
var parameterCount = br.ReadByte();
for (int k = 0; k < parameterCount; ++k)
{
var def = br.ReadByte();
var eventType = br.ReadInt32();
var signalType = br.ReadInt32();
var name = br.ReadUnicodeString();
var xml = br.ReadUnicodeString();
// Add identical parameters only once
var exists = false;
foreach (var param in prop.Parameters)
{
if (param.EventType == eventType && param.SignalType == signalType && param.Name == name && param.XML == xml)
{
exists = true;
break;
}
}
if (!exists)
prop.Parameters.Add(new PropParameter(eventType, signalType, name, xml));
}
// Filter Tir anniversary props
//.........這裏部分代碼省略.........
示例14: Region
public Region(string path)
{
this.Areas = new List<Area>();
using (var fs = new FileStream(path, FileMode.Open))
using (var br = new BinaryReader(fs))
{
Version = br.ReadInt32();
br.ReadInt32(); // Unk
RegionId = br.ReadInt32();
GroupId = br.ReadInt32();
ClientName = br.ReadUnicodeString();
CellSize = br.ReadInt32();
Sight = br.ReadByte();
var areaCount = br.ReadInt32();
br.Skip(0x40); // Unk
Scene = br.ReadUnicodeString();
br.Skip(0x2D); // Unk
Camera = br.ReadUnicodeString();
Light = br.ReadUnicodeString();
br.Skip(0x0C); // Unk
for (int i = 0; i < areaCount; ++i)
{
var areaName = br.ReadUnicodeString();
var area = new Area(Path.Combine(Path.GetDirectoryName(path), areaName + ".area"));
Areas.Add(area);
}
br.Skip(0x1B); // Unk
XML = br.ReadUnicodeString();
}
Name = ClientName;
//Name = Name.Replace("Tin_Beginner_Tutorial", "tir_beginner");
//Name = Name.Replace("Uladh_Cobh_to_Belfast", "cobh_to_belfast");
//Name = Name.Replace("Uladh_Belfast_to_Cobh", "belfast_to_cobh");
//Name = Name.Replace("Cobh_to_Belfast", "cobh_to_belfast_ocean");
//Name = Name.Replace("Belfast_to_Cobh", "belfast_to_cobh_ocean");
//Name = Name.Replace("MonsterRegion", "monster_region");
//Name = Name.Replace("Uladh_main", "tir");
//Name = Name.Replace("Uladh_TirCho_", "tir_");
//Name = Name.Replace("Uladh_Dunbarton", "dunbarton");
//Name = Name.Replace("Uladh_Dun_to_Tircho", "dugald_aisle");
//Name = Name.Replace("Ula_Tirnanog", "tnn");
//Name = Name.Replace("Ula_DgnHall_Dunbarton_before1", "rabbie_altar");
//Name = Name.Replace("Ula_DgnHall_Dunbarton_before2", "math_altar");
//Name = Name.Replace("MiscShop", "general");
//Name = Name.Replace("tir_ChiefHouse", "tir_duncan");
//Name = Name.Replace("Uladh_Dungeon_Black_Wolfs_Hall1", "ciar_altar");
//Name = Name.Replace("Uladh_Dungeon_Black_Wolfs_Hall2", "ciar_entrance");
//Name = Name.Replace("Uladh_Dungeon_Beginners_Hall1", "alby_altar");
//Name = Name.Replace("Uladh_Cobh_harbor", "cobh");
//Name = Name.Replace("Ula_DgnHall_Dunbarton_after", "rabbie_entrance");
//Name = Name.Replace("Ula_hardmode_DgnHall_TirChonaill_before", "alby_hard_altar");
//Name = Name.Replace("Ula_DgnArena_Tircho_Lobby", "alby_arena_lobby");
//Name = Name.Replace("Ula_DgnArena_Tircho_Arena", "alby_arena");
//Name = Name.Replace("Ula_Dun_to_Bangor", "gairech");
//Name = Name.Replace("Ula_Bangor", "bangor");
//Name = Name.Replace("Ula_DgnHall_Bangor_before1", "barri_altar");
//Name = Name.Replace("Ula_DgnHall_Bangor_before2", "barri_entrance_test");
//Name = Name.Replace("Ula_DgnHall_Bangor_after", "barri_entrance");
//Name = Name.Replace("tnn_ChiefHouse", "tnn_duncan");
//Name = Name.Replace("Ula_DgnHall_Tirnanog_before1", "albey_altar");
//Name = Name.Replace("Ula_DgnHall_Tirnanog_before2", "albey_altar_test");
//Name = Name.Replace("Ula_DgnHall_Tirnanog_after", "albey_altar_entrance");
//Name = Name.Replace("Sidhe_Sneachta_S", "sidhe_north");
//Name = Name.Replace("Sidhe_Sneachta_N", "sidhe_south");
//Name = Name.Replace("Ula_DgnHall_Danu_before", "fiodh_altar");
//Name = Name.Replace("Ula_DgnHall_Danu_after", "fiodh_entrance");
//Name = Name.Replace("Ula_", "");
//Name = Name.Replace("Emainmacha", "emain_macha");
//Name = Name.Replace("DgnHall_Coill_before", "coill_altar");
//Name = Name.Replace("DgnHall_Coill_after", "coill_entrance");
//Name = Name.Replace("emain_macha_Ceo", "ceo");
//Name = Name.Replace("DgnHall_Runda_before", "rundal_altar");
//Name = Name.Replace("DgnHall_Runda_after", "rundal_entrance");
//Name = Name.Replace("emain_macha_OidTobar_Hall", "ceo_cellar");
//Name = Name.Replace("Studio_Runda", "studio_rundal_boss");
//Name = Name.Replace("dunbarton_SchoolHall_before", "dunbarton_school_altar");
//Name = Name.Replace("dunbarton_School_LectureRoom", "dunbarton_school_library");
//Name = Name.Replace("Dgnhall_Peaca_before", "peaca_altar");
//Name = Name.Replace("Dgnhall_Peaca_after", "peaca_entrance");
//Name = Name.Replace("DgnHall_Tirnanog_G3_before", "baol_altar");
//Name = Name.Replace("DgnHall_Tirnanog_G3_after", "baol_entrance");
//Name = Name.Replace("Private_Wedding_waitingroom", "emain_macha_wedding_waiting");
//Name = Name.Replace("Private_Wedding_ceremonialhall", "emain_macha_wedding_ceremony");
//Name = Name.Replace("Dugald_Aisle_UserHouse", "dugald_userhouse");
//Name = Name.Replace("tnn_G3_Gairech_Hill", "tnn_gairech");
//Name = Name.Replace("Dugald_Aisle_UserCastleTest1", "user_castle_test_1");
//Name = Name.Replace("Dugald_Aisle_UserCastleTest2", "user_castle_test_2");
//Name = Name.Replace("tnn_G3", "tnn_bangor");
//Name = Regex.Replace(Name, "_TestRegion([0-9]+)", "test_region_$1");
//Name = Regex.Replace(Name, "dugald_userhouse_int_([0-9]+)", "user_house_int_$1");
//Name = Name.Replace("Dugald_Aisle_UserCastle_", "user_castle_");
//Name = Name.Replace("Dugald_Aisle_ModelHouse", "model_house");
//Name = Name.Replace("DgnArena_Dunbarton_Arena", "rabbie_battle_arena");
//Name = Name.Replace("DgnArena_Dunbarton_Lobby", "rabbie_battle_arena_lobby");
//Name = Name.Replace("DgnArena_Dunbarton_waitingroom", "rabbie_battle_arena_waiting");
//Name = Name.Replace("Iria_Harbor_01", "iria_harbor");
//.........這裏部分代碼省略.........
示例15: Build
public override CngKey Build(BinaryReader reader)
{
// skip NULL
reader.Require(Asn1Token.Null);
reader.ReadLengthField();
reader.Require(Asn1Token.BitString);
// length
reader.ReadLengthField();
// unused buts
reader.Skip();
reader.Require(Asn1Token.Sequence);
reader.ReadLengthField();
// Modulus
reader.Require(Asn1Token.Integer);
var modLength = reader.ReadLengthField();
// if the first byte is zero, skip it.
if (reader.Peek() == 0x00)
{
modLength--;
reader.Skip();
}
var modulus = reader.ReadBytes(modLength);
// Exponent
reader.Require(Asn1Token.Integer);
var expLength = reader.ReadLengthField();
var exponent = reader.ReadBytes(expLength);
var parameters = new RSAParameters()
{
Exponent = exponent,
Modulus = modulus
};
var cng = new RSACng();
cng.ImportParameters(parameters);
return cng.Key;
}