Project

General

Profile

Actions

Feature #15560

closed

Add support for read/write offsets.

Added by ioquatix (Samuel Williams) almost 6 years ago. Updated about 2 years ago.

Status:
Closed
Target version:
-
[ruby-core:91235]

Description

It would be nice if read/write/send/recv/etc methods could accept an offset argument.

e.g.

socket = Socket.new(...)
buffer = String.b

socket.read(1024, buffer)
socket.read(1024, buffer, offset: buffer.bytesize)

The same for write, e.g.

socket = Socket.new(...)
buffer = String.b

amount = socket.write(buffer)
socket.write(buffer, offset: amount)

Could also include "size:" so that we can selectively write parts of the buffer.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0