Class: Distillery::Archiver::InputStream

Inherits:
Object
  • Object
show all
Defined in:
lib/distillery/archiver.rb

Overview

InputStream used by Archiver#reader

Direct Known Subclasses

LibArchive::InputStream

Instance Method Summary collapse

Constructor Details

#initialize(io) ⇒ InputStream

Returns a new instance of InputStream.



35
36
37
# File 'lib/distillery/archiver.rb', line 35

def initialize(io)
    @io = io
end

Instance Method Details

#read(length = nil) ⇒ String?

Read data

Parameters:

  • length (Integer, nil) (defaults to: nil)

    number of bytes to read, whole data if nil

Returns:

  • (String, nil)

    data or nil if end of stream



46
47
48
# File 'lib/distillery/archiver.rb', line 46

def read(length=nil)
    @io.read(length)
end