Crowbar::Buffer
Binary-safe byte buffer container for non-destructive and in-place transformations. Handles raw bytes, arbitrary non-UTF-8 binaries, and provides slicing/splicing helpers.
Constructors
Instance methods
bytes
Sourceclone
Sourceempty?
SourceFind balanced delimiter pairs like (), [], {}, <>, "", ''
Searches for a needle sequence starting at offset
Replace a slice with another slice
size
SourceSwaps two equal-length ranges of bytes in-place
to_raw_s
SourceAppends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>
to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO) which can be overridden for custom implementations.
Also see #inspect.
to_slice
Source