class Async::HTTP::Body::Fixed
def close(error = nil)
def close(error = nil) if @remaining != 0 @stream.close end super end
def empty?
def empty? @remaining == 0 end
def initialize(stream, length)
def initialize(stream, length) @stream = stream @length = length @remaining = length end
def inspect
def inspect "\#<#{self.class} length=#{@length} remaining=#{@remaining}>" end
def join
def join buffer = @stream.read(@remaining) @remaining = 0 return buffer end
def read
def read if @remaining > 0 if chunk = @stream.read_partial(@remaining) @remaining -= chunk.bytesize return chunk end end end