public static void ReadString(this MsgPackReader reader, string value) { reader.ReadPrefix(TypePrefixes.FixRaw); if (reader.ReadRawString() != value) { throw new InvalidOperationException(Resources.ParseError); } }
public static PupilDataFrame FromStream(Stream stream) { var reader = new MsgPackReader(stream); var frame = new PupilDataFrame(); reader.ReadPrefix(TypePrefixes.Map16); while (reader.Read() && reader.Type == TypePrefixes.FixRaw) { var key = reader.ReadRawString(); Action <MsgPackReader, PupilDataFrame> setter; if (ParserMap.TryGetValue(key, out setter)) { setter(reader, frame); } } return(frame); }
void SkipField() { if (!io.Read()) { return; } if (!io.IsArray() && !io.IsMap()) { //NOTE: if value is a raw string we need to read all of its data if (io.IsRaw()) { io.ReadRawString(); } return; } uint array_len = io.Length; for (uint i = 0; i < array_len; ++i) { SkipField(); } }
public static string ReadString(this MsgPackReader reader) { reader.ReadPrefix(TypePrefixes.FixRaw); return(reader.ReadRawString()); }