Class: ADSP::Test::Mock::String
- Defined in:
- lib/adsp/test/mock/string.rb
Overview
ADSP::Test::Mock::String class.
Constant Summary
Constants inherited from String
String::BUFFER_LENGTH_NAMES, String::Option
Class Method Summary collapse
- .native_compress_string(source, options) ⇒ Object
- .native_decompress_string(source, options) ⇒ Object
Methods inherited from String
Class Method Details
.native_compress_string(source, options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/adsp/test/mock/string.rb', line 13 def self.native_compress_string(source, ) destination_buffer_length = [:destination_buffer_length] result = "".b loop do data, bytes_read = Common.native_compress source, destination_buffer_length source = source.byteslice bytes_read, source.bytesize - bytes_read result << data break if source.bytesize.zero? end result end |
.native_decompress_string(source, options) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/adsp/test/mock/string.rb', line 28 def self.native_decompress_string(source, ) destination_buffer_length = [:destination_buffer_length] result = "".b loop do data, bytes_read = Common.native_decompress source, destination_buffer_length source = source.byteslice bytes_read, source.bytesize - bytes_read result << data break if source.bytesize.zero? end result end |