You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ How to add buffering to a Stream?
39
39
Sometimes, you can significantly improve performance by reading many bytes at once.
40
40
For example, [according to SPIFFS's wiki](https://github.com/pellepl/spiffs/wiki/Performance-and-Optimizing#reading-files), reading read files in chunks of 64 bytes is much faster than reading them one byte at a time.
To buffer the input, decorate the original `Stream` with `ReadBufferingStream`. For example, suppose your program reads a JSON document from SPIFFS like that:
45
45
@@ -72,7 +72,7 @@ Adding a buffer only makes sense for **unbuffered** streams. For example, there
72
72
Similarly, you can improve performance significantly by writing many bytes at once.
73
73
For example, writing to `WiFiClient` one byte at a time is very slow; it's much faster if you send large chunks.
To add a buffer, decorate the original `Stream` with `WriteBufferingStream`. For example, if your program sends a JSON document via `WiFiClient`, like that:
78
78
@@ -101,7 +101,7 @@ How to add logging to a stream?
101
101
102
102
When debugging a program that makes HTTP requests, you first want to check whether the request is correct. With this library, you can decorate the `EthernetClient` or the `WiFiClient` to log everything to the serial.
@@ -127,7 +127,7 @@ Everything you write to `loggingClient` is written to `client` and logged to `Se
127
127
128
128
Similarly, you often want to see what the HTTP server sent back. With this library, you can decorate the `EthernetClient` or the `WiFiClient` to log everything to the serial.
@@ -154,7 +154,7 @@ If your program receives data from one serial port and logs to another, **ensure
154
154
155
155
Of course, you could log read and write operations by combining `ReadLoggingStream` and `WriteLoggingStream`, but there is a simpler solution: `LoggingStream`.
@@ -228,7 +228,7 @@ Like every `Stream` decorator in this library, `HammingDecodingStream<7, 4>` sup
228
228
229
229
The class `HammingStream<7, 4>` combines the features of `HammingEncodingStream<7, 4>` and `HammingDecodingStream<7, 4>`, which is very useful when you do two-way communication.
This function repeatedly waits and retries until it times out.
256
256
You can customize the `wait()` function; by default, it's [`yield()`](https://www.arduino.cc/en/Reference/SchedulerYield).
@@ -279,7 +279,7 @@ How to use a `String` as a stream?
279
279
Sometimes, you use a piece of code that expects a `Print` instance (like `ReadLoggingStream`), but you want the output in a `String` instead of a regular `Stream`.
280
280
In that case, use the `StringPrint` class. It wraps a `String` within a `Print` implementation.
Similarly, there are cases where you have a `String`, but you need to pass a `Stream` to some other piece of code. In that case, use `StringStream`; it's similar to `StrintPrint`, except you can also read from it.
SteamUtils also allows using EEPROM as a stream. Create an instance of `EepromStream` and specify the start address and the size of the region you want to expose.
0 commit comments