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.
User avatar
HDKLog
Posts: 41
Joined: Thu Aug 18, 2016 12:36 am
Been thanked: 2 times

Byte peeking from streams

Postby HDKLog » Sun Mar 15, 2020 12:58 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Byte peeking from streams

Postby Giovanni » Sun Mar 15, 2020 2:55 pm

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: 41
Joined: Thu Aug 18, 2016 12:36 am
Been thanked: 2 times

Re: Byte peeking from streams

Postby HDKLog » Sun Mar 15, 2020 3:41 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Byte peeking from streams  Topic is solved

Postby Giovanni » Sun Mar 15, 2020 4:06 pm

Hi,

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

Giovanni


Return to “Small Change Requests”

Who is online

Users browsing this forum: No registered users and 6 guests