Byte peeking from streams Topic is solved

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
Post Reply
User avatar
HDKLog
Posts: 45
Joined: Thu Aug 18, 2016 12:36 am
Has thanked: 1 time
Been thanked: 3 times

Byte peeking from streams

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Byte peeking from streams

Post 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
User avatar
HDKLog
Posts: 45
Joined: Thu Aug 18, 2016 12:36 am
Has thanked: 1 time
Been thanked: 3 times

Re: Byte peeking from streams

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Byte peeking from streams

Post by Giovanni »

Hi,

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

Giovanni
Post Reply