Class: Chef::CookbookSiteStreamingUploader::StreamPart

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/cookbook_site_streaming_uploader.rb

Instance Method Summary collapse

Constructor Details

#initialize(stream, size) ⇒ StreamPart

Returns a new instance of StreamPart.



165
166
167
# File 'lib/chef/cookbook_site_streaming_uploader.rb', line 165

def initialize(stream, size)
  @stream, @size = stream, size
end

Instance Method Details

#read(offset, how_much) ⇒ Object

read the specified amount from the stream



174
175
176
# File 'lib/chef/cookbook_site_streaming_uploader.rb', line 174

def read(offset, how_much)
  @stream.read(how_much)
end

#sizeObject



169
170
171
# File 'lib/chef/cookbook_site_streaming_uploader.rb', line 169

def size
  @size
end