Class: Aws::S3::FilePart Private
- Inherits:
-
Object
- Object
- Aws::S3::FilePart
- Defined in:
- lib/aws-sdk-s3/file_part.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A utility class that provides an IO-like interface to a portion of a file on disk.
Instance Attribute Summary collapse
- #first_byte ⇒ Integer readonly private
- #last_byte ⇒ Integer readonly private
- #size ⇒ Integer readonly private
- #source ⇒ String, ... readonly private
Instance Method Summary collapse
- #close ⇒ Object private
-
#initialize(options = {}) ⇒ FilePart
constructor
private
A new instance of FilePart.
- #read(bytes = nil, output_buffer = nil) ⇒ Object private
- #rewind ⇒ Object private
Constructor Details
#initialize(options = {}) ⇒ FilePart
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FilePart.
19 20 21 22 23 24 25 |
# File 'lib/aws-sdk-s3/file_part.rb', line 19 def initialize( = {}) @source = [:source] @first_byte = [:offset] @last_byte = @first_byte + [:size] @size = [:size] @file = nil end |
Instance Attribute Details
#first_byte ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/aws-sdk-s3/file_part.rb', line 31 def first_byte @first_byte end |
#last_byte ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/aws-sdk-s3/file_part.rb', line 34 def last_byte @last_byte end |
#size ⇒ Integer (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/aws-sdk-s3/file_part.rb', line 37 def size @size end |
#source ⇒ String, ... (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 |
# File 'lib/aws-sdk-s3/file_part.rb', line 28 def source @source end |
Instance Method Details
#close ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
52 53 54 |
# File 'lib/aws-sdk-s3/file_part.rb', line 52 def close @file.close if @file end |
#read(bytes = nil, output_buffer = nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 42 |
# File 'lib/aws-sdk-s3/file_part.rb', line 39 def read(bytes = nil, output_buffer = nil) open_file unless @file read_from_file(bytes, output_buffer) end |
#rewind ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
44 45 46 47 48 49 50 |
# File 'lib/aws-sdk-s3/file_part.rb', line 44 def rewind if @file @file.seek(@first_byte) @position = @first_byte end 0 end |