Method: Stupidedi::Reader::FileInput#take

Defined in:
lib/stupidedi/reader/input/file_input.rb

#take(n) ⇒ String



49
50
51
52
53
54
55
# File 'lib/stupidedi/reader/input/file_input.rb', line 49

def take(n)
  @io.seek(@offset)

  # Calling @io.read with more than the number of available bytes will
  # return nil, so we have to calculate how many bytes remain
  @io.read((n <= @size) ? n : @size)
end