Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: Skype Personal integration with C# Pin
Member 1462363929-Sep-22 19:48
Member 1462363929-Sep-22 19:48 
QuestionAsync - await Pin
dataminers20-Sep-22 4:22
dataminers20-Sep-22 4:22 
AnswerRe: Async - await Pin
OriginalGriff20-Sep-22 4:57
mveOriginalGriff20-Sep-22 4:57 
GeneralRe: Async - await Pin
Richard Deeming20-Sep-22 5:01
mveRichard Deeming20-Sep-22 5:01 
AnswerRe: Async - await PinPopular
Richard Deeming20-Sep-22 5:06
mveRichard Deeming20-Sep-22 5:06 
GeneralRe: Async - await Pin
MarkTJohnson20-Sep-22 5:47
professionalMarkTJohnson20-Sep-22 5:47 
GeneralRe: Async - await Pin
dataminers21-Sep-22 0:04
dataminers21-Sep-22 0:04 
GeneralRe: Async - await Pin
Richard Deeming21-Sep-22 2:07
mveRichard Deeming21-Sep-22 2:07 
GeneralRe: Async - await Pin
dataminers21-Sep-22 5:33
dataminers21-Sep-22 5:33 
QuestionHow to make a license key system with Realtime DB? Pin
Moses Man19-Sep-22 0:11
Moses Man19-Sep-22 0:11 
AnswerRe: How to make a license key system with Realtime DB? Pin
OriginalGriff19-Sep-22 2:21
mveOriginalGriff19-Sep-22 2:21 
QuestionHow to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 6:16
Alex Wright 202216-Sep-22 6:16 
AnswerRe: How to create a many-to-many relationship between users in a table? Pin
Gerry Schmitz16-Sep-22 6:30
mveGerry Schmitz16-Sep-22 6:30 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 6:33
Alex Wright 202216-Sep-22 6:33 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Gerry Schmitz16-Sep-22 6:42
mveGerry Schmitz16-Sep-22 6:42 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Alex Wright 202216-Sep-22 6:55
Alex Wright 202216-Sep-22 6:55 
GeneralRe: How to create a many-to-many relationship between users in a table? Pin
Eddy Vluggen16-Sep-22 23:59
professionalEddy Vluggen16-Sep-22 23:59 
SuggestionRe: How to create a many-to-many relationship between users in a table? Pin
Richard Deeming19-Sep-22 21:16
mveRichard Deeming19-Sep-22 21:16 
QuestionProgram instalator in C#, Visual Studio Pin
Ismael_199912-Sep-22 5:36
Ismael_199912-Sep-22 5:36 
AnswerRe: Program instalator in C#, Visual Studio Pin
Gerry Schmitz12-Sep-22 6:21
mveGerry Schmitz12-Sep-22 6:21 
AnswerRe: Program instalator in C#, Visual Studio Pin
OG MAYOR MRL25-Sep-22 2:48
OG MAYOR MRL25-Sep-22 2:48 
Questionreading memory stream in byte chunks Pin
mjeeves10-Sep-22 8:41
mjeeves10-Sep-22 8:41 
GeneralRe: reading memory stream in byte chunks Pin
harold aptroot10-Sep-22 9:49
harold aptroot10-Sep-22 9:49 
BinaryWriter.Write(string) writes a length-preceded string to the stream, with the length encoded as a variable-length integer (7 bits per block and a continuation bit). So some extra stuff appeared in your stream that you didn't count on.

BinaryWriter.Write(string) is most easily "mirrored" by using BinaryReader.ReadString in the decoder. Of course, you can also handle the length manually, but then you should probably also handle the encoding and write raw bytes to the stream to start with.

This is also wrong: _memoryStream.Read(readChunkSize, 0, 3); reading 3 bytes instead of 4. Why not use BinaryReader, it's simpler and less error prone.

By having written one extra byte per mistake (the extra length byte that BinaryWriter.Write(string) wrote, could have been more bytes for longer strings) and by having read one byte too few, a two byte discrepancy was created. Actually you should find that there are two unprintable characters at the start of your string, since it still should be 12 bytes, just not quite the right 12 bytes.
GeneralRe: reading memory stream in byte chunks Pin
mjeeves10-Sep-22 10:04
mjeeves10-Sep-22 10:04 
GeneralRe: reading memory stream in byte chunks Pin
harold aptroot10-Sep-22 10:15
harold aptroot10-Sep-22 10:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.