Class: ZSTDS::String

Inherits:
ADSP::String
  • Object
show all
Defined in:
lib/zstds/string.rb

Overview

ZSTDS::String class.

Constant Summary collapse

Option =

Current option class.

ZSTDS::Option

Class Method Summary collapse

Class Method Details

.compress(source, options = {}) ⇒ Object

Compresses source string using options. Option: :destination_buffer_length destination buffer length. Option: :pledged_size source bytesize. Returns compressed string.



20
21
22
23
24
25
26
27
28
# File 'lib/zstds/string.rb', line 20

def self.compress(source, options = {})
  Validation.validate_string source

  options = Option.get_compressor_options options, BUFFER_LENGTH_NAMES

  options[:pledged_size] = source.bytesize

  super source, options
end

.native_compress_string(*args) ⇒ Object

Bypasses native compress.



31
32
33
# File 'lib/zstds/string.rb', line 31

def self.native_compress_string(*args)
  ZSTDS._native_compress_string(*args)
end

.native_decompress_string(*args) ⇒ Object

Bypasses native decompress.



36
37
38
# File 'lib/zstds/string.rb', line 36

def self.native_decompress_string(*args)
  ZSTDS._native_decompress_string(*args)
end