class Sinatra::Helpers::StaticFile
def each
def each if @range self.pos = @range.begin length = @range.end - @range.begin + 1 while length > 0 && (buf = read([CHUNK_SIZE,length].min)) yield buf length -= buf.length end else rewind while buf = read(CHUNK_SIZE) yield buf end end end