class ZipTricks::OffsetIO
- ZipTricks::OffsetIO
- IO
- Reference
- Object
Defined in:
offset_io.crConstructors
Instance Method Summary
- #advance(by : Int)
- #offset : UInt64
-
#read(slice : Bytes)
Does nothing but must be implemented since Crystal does not differentiate between Writesr/Readers
-
#write(slice : Bytes) : Nil
Writes the contents of slice into this
IO
.
Constructor Detail
Instance Method Detail
def read(slice : Bytes)
#
Does nothing but must be implemented since Crystal does not differentiate between Writesr/Readers
def write(slice : Bytes) : Nil
#
Description copied from class IO
Writes the contents of slice into this IO
.
io = IO::Memory.new
slice = Bytes.new(4) { |i| ('a'.ord + i).to_u8 }
io.write(slice)
io.to_s # => "abcd"