-
Notifications
You must be signed in to change notification settings - Fork 31
AMQNET-625: Content Property of IBytesMessage should be idempotent #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -31,10 +31,11 @@ public class AmqpNmsBytesMessageFacade : AmqpNmsMessageFacade, INmsBytesMessageF | |||||||||||||||
| private EndianBinaryReader byteIn = null; | ||||||||||||||||
| private EndianBinaryWriter byteOut = null; | ||||||||||||||||
|
|
||||||||||||||||
| private static readonly Data EMPTY_DATA = new Data { Binary = new byte[0] }; | ||||||||||||||||
| private static readonly byte[] EMPTY_BINARY = new byte[0]; | ||||||||||||||||
| private static readonly Data EMPTY_DATA = new Data { Binary = EMPTY_BINARY }; | ||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
+35
to
36
|
||||||||||||||||
| private static readonly Data EMPTY_DATA = new Data { Binary = EMPTY_BINARY }; |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After updating the body section, reset any cached readers/writers (byteIn, byteOut) to avoid stale stream state when consuming or writing content again.
| set => Message.BodySection = new Data { Binary = value }; | |
| set | |
| { | |
| Message.BodySection = new Data { Binary = value }; | |
| byteIn = null; | |
| byteOut = null; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This private overload shares the same name as the public
ReadBytesmethod, which may cause confusion. Consider renaming it to something likeReadBytesInternal.