Module: FastImage::StreamUtil

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#read_byteObject



444
445
446
# File 'lib/fastimage.rb', line 444

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

#read_intObject



448
449
450
# File 'lib/fastimage.rb', line 448

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

#read_string_intObject



452
453
454
455
456
457
458
# File 'lib/fastimage.rb', line 452

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