public InternalDataBlock Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var blockType = parser.TakeAndSkip(1).ToInt32(); var blockLevel = parser.TakeAndSkip(1).ToInt32(); var numberOfEntries = parser.TakeAndSkip(2).ToInt32(); var totalByteCount = parser.TakeAndSkip(4).ToInt32(); var entries = parser.TakeAndSkip(numberOfEntries * 8); var padding = BinaryData.Empty(); var remainingTo64Boundary = Utilities.GetRemainingToNextMultipleOf(numberOfEntries * 8 + 8, 64); if (remainingTo64Boundary > 0) { padding = parser.TakeAndSkip(remainingTo64Boundary); } var trailer = parser.TakeAndSkip(16, trailerDecoder); return(new InternalDataBlock( blockType, blockLevel, numberOfEntries, totalByteCount, entries, padding, trailer)); }
public Header Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new Header( parser.TakeAndSkip(4), parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(2), parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(4), parser.TakeAndSkip(4), parser.TakeAndSkip(8), parser.TakeAndSkip(8).ToInt64(), parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(32, 4, new FuncBasedDecoder <NID>(NID.OfValue)), parser.TakeAndSkip(8), parser.TakeAndSkip(72, rootDecoder), parser.TakeAndSkip(4), parser.TakeAndSkip(128), parser.TakeAndSkip(128), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(2), parser.TakeAndSkip(8).ToInt64(), parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(3), parser.TakeAndSkip(1), parser.TakeAndSkip(32))); }
public static HNBITMAPHDR OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new HNBITMAPHDR( parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(64))); }
public INBTEntry Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (INBTEntry.OfValue( NID.OfValue(parser.TakeAndSkip(4)), parser.TakeAtWithoutChangingStreamPosition(8, 16, brefDecoder))); }
public IndexRecord Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new IndexRecord( parser.TakeAndSkip(keySize), parser.TakeAndSkip(4, hidDecoder))); }
public DataRecord Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new DataRecord( parser.TakeAndSkip(keySize), parser.TakeAndSkip(dataSize))); }
public AMap Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new AMap( parser.TakeAndSkip(496), parser.TakeAndSkip(16, pageTrailerDecoder))); }
public IBBTEntry Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (IBBTEntry.OfValue( parser.TakeAndSkip(8, bidDecoder), parser.TakeAndSkip(16, brefDecoder))); }
public BREF Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (BREF.OfValue( parser.TakeAndSkip(8, bidDecoder), parser.TakeAndSkip(8, biDecoder))); }
public static HNPAGEMAP OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var allocationCount = parser.TakeAndSkip(2).ToInt32(); var freeCount = parser.TakeAndSkip(2).ToInt32(); var allocationTable = parser.TakeAndSkip((allocationCount + 1) * 2); return(new HNPAGEMAP(allocationCount, freeCount, allocationTable)); }
public static EntryId OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new EntryId( parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(16).Value, NID.OfValue(parser.TakeAndSkip(4)))); }
public LBBTEntry Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new LBBTEntry( parser.TakeAndSkip(16, brefDecoder), parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(4))); }
public BlockTrailer Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new BlockTrailer( parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(8, bidDecoder))); }
public SIEntry Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var nodeId = parser.TakeAndSkip(8); return new SIEntry( NID.OfValue(nodeId.Take(4)), parser.TakeAndSkip(8, bidDecoder)); }
public static TCOLDESC OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new TCOLDESC( parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(2).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32())); }
public static HID OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var value = parser.TakeAndSkip(4).ToInt32(); return (new HID( value & 0x0000001F, (value >> 5) & 0x000003FF, (value >> 16) & 0x0000FFFF)); }
public static BTHHEADER OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new BTHHEADER( parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), HID.OfValue(parser.TakeAndSkip(4)))); }
public BTPage Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new BTPage( parser.TakeAndSkip(488), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(4), parser.TakeAndSkip(16, pageTrailerDecoder))); }
public SLEntry Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var localNID = parser.TakeAndSkip(8); var subnodeBID = parser.TakeAndSkip(8); var subnodeNID = parser.TakeAndSkip(8); return (new SLEntry( NID.OfValue(localNID.Take(4)), bidDecoder.Decode(subnodeBID), bidDecoder.Decode(subnodeNID))); }
public LNBTEntry Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var nid = NID.OfValue(parser.TakeAndSkip(4)); parser.TakeAndSkip(4); return (new LNBTEntry( nid, parser.TakeAndSkip(8, bidDecoder), parser.TakeAndSkip(8, bidDecoder), NID.OfValue(parser.TakeAndSkip(4)), parser.TakeAndSkip(4))); }
public Root Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return (new Root( parser.TakeAndSkip(4).ToInt32(), parser.TakeAndSkip(8).ToInt64(), parser.TakeAndSkip(8).ToInt64(), parser.TakeAndSkip(8).ToInt64(), parser.TakeAndSkip(8).ToInt64(), parser.TakeAndSkip(16, brefDecoder), parser.TakeAndSkip(16, brefDecoder), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(1).ToInt32(), parser.TakeAndSkip(2).ToInt32())); }
public static NAMEID OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var propertyId = parser.TakeAndSkip(4).ToInt32(); var typeNameGuidIndex = parser.TakeAndSkip(2).ToInt32(); var propertyIndex = parser.TakeAndSkip(2).ToInt32(); return (new NAMEID( propertyId, typeNameGuidIndex & 0x0001, (typeNameGuidIndex & 0xFFFE) >> 1, propertyIndex)); }
public static TCINFO OfValue(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var type = parser.TakeAndSkip(1).ToInt32(); var numberOfColumns = parser.TakeAndSkip(1).ToInt32(); var groupsOffsets = parser.Slice(4, 2).Select(s => s.ToInt32()).ToArray(); var rowIndex = HID.OfValue(parser.TakeAndSkip(4)); var rowMatrix = parser.TakeAndSkip(4); var deprecated = parser.TakeAndSkip(4); var columnDescriptors = parser.TakeAndSkip(numberOfColumns, 8, new FuncBasedDecoder <TCOLDESC>(TCOLDESC.OfValue)); return (new TCINFO( type, numberOfColumns, groupsOffsets, rowIndex, rowMatrix, deprecated, columnDescriptors)); }
public SubnodeBlock Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); var blockType = parser.TakeAndSkip(1).ToInt32(); var blockLevel = parser.TakeAndSkip(1).ToInt32(); var entrySize = blockLevel == 1 ? 16 : 24; var numberOfEntries = parser.TakeAndSkip(2).ToInt32(); var padding = parser.TakeAndSkip(4); var entries = parser.TakeAndSkip(numberOfEntries * entrySize); var entriesPadding = BinaryData.Empty(); var remainingTo64Boundary = Utilities.GetRemainingToNextMultipleOf(numberOfEntries * entrySize + 8, 64); if (remainingTo64Boundary > 0) { entriesPadding = parser.TakeAndSkip(remainingTo64Boundary); } var trailer = parser.TakeAndSkip(16, trailerDecoder); return (new SubnodeBlock( blockType, blockLevel, numberOfEntries, padding, entries, entriesPadding, trailer)); }
public PropertyType Decode(BinaryData encodedData) { var parser = BinaryDataParser.OfValue(encodedData); return(new PropertyType(parser.TakeAndSkip(2, int32Decoder))); }