-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update Buffer implementation #9
Conversation
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.
Some comments :)
@whyoleg, thanks for the review. Looks like all points are valid, will fix soon |
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.
Overall LGTM, with more or less minor remarks (small amount about design). In coming days will try to play with API a bit in scope of rsocket-kotlin frame/transport logic and may be will have some more feedback
writeIndex = 0 | ||
} | ||
|
||
public operator fun Buffer.get(index: Int): Byte = getByteAt(index) |
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.
do we really need these operators? how often are they used?
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.
I made these operations to mimic ByteArray
.
@rsinukov, @whyoleg /**
* Create a new [Buffer] from current and replace all content of this buffer with empty.
**/
fun steal(): Buffer This method is an alternative to having mutable buffer access and using it will be possible to avoid making copies. Could you tell me if it's ok to have it and add in the current PR? Or I should create a new PR for the discussion. |
let's move it to next PR, it's already a lot of changes and comments in this PR |
I agree, let's have it in the next PR |
No description provided.