[ruby-core:78999] Re: [Ruby trunk Bug#13110] Byte-based operations for String

From: Eric Wong <normalperson@...>
Date: 2017-01-06 21:30:08 UTC
List: ruby-core #78999
Kirk Haines <wyhaines@gmail.com> wrote:
> My software makes use of buffers of network data where the character
> encodings are irrelevant. They are just streams of bytes being moved
> around, and sometimes manipulated along the way, and the byte based
> operations that you propose would be extremely useful.

Agreed to some extent.  I think we could also use a byteslice!
bang method to efficiently deal with partial writes.  But then,
! probably isn't safe on user-supplied data with Rack or most
frameworks; only a custom vertically-integrated network apps...

For reading and parsing operations, I'm not sure they're needed
because IO#read/read_nonblock/etc all return binary strings when
passed explicit length arg; and //n exists for Regexp.  (And any
socket server reading without a length arg would be dangerous)

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next