public static Message Deserialize(BinaryReader reader) { int structType = reader.ReadInt32(); int pathCount = reader.ReadInt32(); string[] path = new string[pathCount]; for (int i = 0; i < pathCount; i++) { int sizeOfString = reader.ReadInt32(); byte[] pathNameBytes = reader.ReadBytes(sizeOfString); path[i] = Encoding.Unicode.GetString(pathNameBytes); } KeyDescriptor keyDescriptor = KeyDescriptor.Deserialize(reader); RecordDescriptor recordDescriptor = RecordDescriptor.Deserialize(reader); ILocator locator = STSdb4.Database.Locator.Obtain(structType, keyDescriptor, recordDescriptor, path); IndexPersistOperationCollection persistOperations = new IndexPersistOperationCollection(locator); IOperationCollection operations = persistOperations.Read(reader); return(new Message(operations)); }
public void Decode() { using (MemoryStream ms = new MemoryStream(Raw)) { BinaryReader reader = new BinaryReader(ms); KeyDescriptor = KeyDescriptor.Deserialize(reader); RecordDescriptor = RecordDescriptor.Deserialize(reader); IsDecoded = true; } }