Class: Amp::Core::Repositories::Git::Encoding::BinaryDelta::InsertHunk
- Inherits:
-
Object
- Object
- Amp::Core::Repositories::Git::Encoding::BinaryDelta::InsertHunk
- Defined in:
- lib/amp-git/encoding/binary_delta.rb
Overview
A Hunk that performs an insert operation. One of two types of delta hunks in the git binary delta format.
Instance Method Summary collapse
-
#apply(output, input) ⇒ Object
Applies the Hunk with a given output buffer with an input string.
-
#initialize(opcode, fp) ⇒ InsertHunk
constructor
Creates a new insert hunk.
Constructor Details
#initialize(opcode, fp) ⇒ InsertHunk
Creates a new insert hunk.
117 118 119 |
# File 'lib/amp-git/encoding/binary_delta.rb', line 117 def initialize(opcode, fp) @data = fp.read(opcode & 0x7f) end |
Instance Method Details
#apply(output, input) ⇒ Object
Applies the Hunk with a given output buffer with an input string.
126 127 128 |
# File 'lib/amp-git/encoding/binary_delta.rb', line 126 def apply(output, input) output.write @data end |