module ChupaText::Decomposers::Tar::CopyStreamable

TODO: Supporting output buffer in read and readpartial should be done in RubyGems' tar implementation.

Public Instance Methods

readpartial(max_length, buffer=nil) click to toggle source
Calls superclass method
# File lib/chupa-text/decomposers/tar.rb, line 55
def readpartial(max_length, buffer=nil)
  data = super(max_length)
  if data.nil?
    if max_length.zero?
      return ""
    else
      raise EOFError
    end
  end

  if buffer.nil?
    data
  else
    buffer.replace(data)
    buffer
  end
end