Method: StringInput#read

Defined in:
lib/extensions/crypt/crypt/stringio.rb

#read(len = nil) ⇒ Object Also known as: sysread



150
151
152
153
154
155
156
157
# File 'lib/extensions/crypt/crypt/stringio.rb', line 150

def read( len = nil )
  stream_check!
  return read_all unless len
  str = @src[@pos, len]
  @pos += len
  @pos += 1 if @pos == @src.size
  str
end