class Async::HTTP::FixedBody
def closed?
def closed? @remaining == 0 end
def each
def each while @remaining > 0 if chunk = @stream.read(CHUNK_LENGTH) @remaining -= chunk.bytesize yield chunk end end end
def initialize(length, stream)
def initialize(length, stream) @length = length @remaining = length @stream = stream end
def read
def read buffer = @stream.read(@remaining) @remaining = 0 return buffer end