Page 1 of 1

Byte peeking from streams

Posted: Sun Mar 15, 2020 12:58 pm
by HDKLog
Hello,
It would be very useful to have a "peek" method for Streams. There are many cases when you need to get the first byte of the stream without popping it out and having method streamPeek() along with streamPut() and streamGet() will help to reduce extra workaround and keeping code more light and clear.

Re: Byte peeking from streams

Posted: Sun Mar 15, 2020 2:55 pm
by Giovanni
Hi,

This would be high-impact, not all stream implementations are able to "peek" from the stream, in addition, all implementations should be modified.

Giovanni

Re: Byte peeking from streams

Posted: Sun Mar 15, 2020 3:41 pm
by HDKLog
Hello Giovanni, how about implementing it in descendants of BaseSequentialStream class where it is easy and trivial. You can move it in BaseSequentialStream when implementation will be available in all descendants of BaseSequentialStream.

Harry.

Re: Byte peeking from streams  Topic is solved

Posted: Sun Mar 15, 2020 4:06 pm
by Giovanni
Hi,

I will consider it but not before next release, it is almost done now.

Giovanni