Module: FastImage::StreamUtil

Included in:
FiberStream, IOStream
Defined in:
lib/fastimage.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#read_byteObject



457
458
459
# File 'lib/fastimage.rb', line 457

def read_byte
  read(1)[0].ord
end

#read_intObject



461
462
463
# File 'lib/fastimage.rb', line 461

def read_int
  read(2).unpack('n')[0]
end

#read_string_intObject



465
466
467
468
469
470
471
# File 'lib/fastimage.rb', line 465

def read_string_int
  value = []
  while read(1) =~ /(\d)/
    value << $1
  end
  value.join.to_i
end