public static SignedStroke GetSignedStroke(Stream source) { byte[] ownerBytes = new byte[OWNER_NAME_BYTES_ARRAY_LENGTH]; source.Read(ownerBytes, 0, ownerBytes.Length); byte[] idBytes = new byte[sizeof(UInt32)]; source.Read(idBytes, 0, idBytes.Length); DrawingAttributes attributes = GetDrawingAttributes(source); StylusPointCollection points = new StylusPointCollection(); byte[] numberOfPointsBytes = new byte[sizeof(UInt32)]; source.Read(numberOfPointsBytes, 0, numberOfPointsBytes.Length); int numberOfPoints = BitConverter.ToInt32(numberOfPointsBytes, 0); for (int x = numberOfPoints; x != 0; x--) { points.Add(GetPoint(source)); } SignedStroke stroke = new SignedStroke(points, attributes); stroke.Owner = StringBitConverter.GetString(ownerBytes).Replace("\0", ""); stroke.Id = BitConverter.ToUInt32(idBytes, 0); return(stroke); }
private void getNameFromRemote() { byte[] nameBuffer = new byte[sizeof(char) * 128]; remoteStream.Read(nameBuffer, 0, nameBuffer.Length); RemoteName = StringBitConverter.GetString(nameBuffer).Replace("\0", ""); }