Stephen R. van den Berg wrote:
Benefits of the new String.Buffer implementation:
- Close to drop-in replacement for IOBuffer.
- Performance hovers around that of IOBuffer's.
- Support all native Pike character widths.
- Backward compatible with the old String.Buffer.
- Creating a String.Buffer object from a shared string does *not* incur
a single copy (and is thus very lightweight).
- A String.Buffer initialised from a shared string allows one to
access the shared string in parts without copying the data at all.
- Supports System.Memory objects just like IOBuffer.
- No need to account for locks on subbuffers; String.Buffer resolves
those automatically and on demand.
- Explicit copying of the buffer data is not supported anymore, the
implicit copy-on-demand mechanism is more efficient.
I would almost forget: - Supports unread(string|Buffer str) which allows one to push back strings at the front of the buffer.