Class: Aws::S3::FilePart Private
- Inherits:
-
Object
- Object
- Aws::S3::FilePart
- Defined in:
- lib/aws-sdk-resources/services/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.
14 15 16 17 18 19 20 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 14 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.
26 27 28 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 26 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.
29 30 31 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 29 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.
32 33 34 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 32 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.
23 24 25 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 23 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.
47 48 49 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 47 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.
34 35 36 37 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 34 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.
39 40 41 42 43 44 45 |
# File 'lib/aws-sdk-resources/services/s3/file_part.rb', line 39 def rewind if @file @file.seek(@first_byte) @position = @first_byte end 0 end |