Github user Jens-G commented on the pull request:
https://github.com/apache/thrift/pull/177#issuecomment-56222777
I like the idea. But Peek() isn't actually a peek, it is a read operation.
Let's just take this (theoretical) scenario:
* call `transport.Peek()` to effectively read a Byte
* now call `transport.Read()` instead of `transport.ReadAll()`
* depending on the Transport used, you may lose the peeked Byte, maybe read
it later out of band.
I haven't checked the entire code if that is currently the case, but I
don't like even the possibility of this. To me it would unexpected that Read
and ReadAll differ that much.
While we're at it, why don't we implement a real peek operation? Again, I
like the idea!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---