method
each_byte
v1_8_7_330 -
Show latest stable
- Class:
StringIO
each_byte()public
See IO#each_byte.
/*
* call-seq:
* strio.each_byte {|byte| block } -> strio
*
* See IO#each_byte.
*/
static VALUE
strio_each_byte(self)
VALUE self;
{
struct StringIO *ptr = readable(StringIO(self));
RETURN_ENUMERATOR(self, 0, 0);
while (ptr->pos < RSTRING_LEN(ptr->string)) {
char c = RSTRING_PTR(ptr->string)[ptr->pos++];
rb_yield(CHR2FIX(c));
}
return self;
} Related methods
- Instance methods
- <<
- binmode
- bytes
- chars
- close
- close_read
- close_write
- closed?
- closed_read?
- closed_write?
- each
- each_byte
- each_char
- each_line
- eof
- eof
- eof?
- eof?
- fcntl
- fileno
- flush
- fsync
- getbyte
- getc
- gets
- initialize_copy
- isatty
- length
- lineno
- lineno=
- lines
- path
- pid
- pos
- pos
- pos=
- printf
- putc
- puts
- read
- readbyte
- readchar
- readline
- readline
- readlines
- reopen
- rewind
- rewind
- seek
- seek
- size
- string
- string=
- sync
- sync=
- sysread
- syswrite
- tell
- truncate
- tty?
- ungetc
- write
- Class methods
- new
- new
- open