class ZipTricks::OffsetIO

Defined in:

offset_io.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(any_io : IO) #

[View source]

Instance Method Detail

def advance(by : Int) #

[View source]
def offset : UInt64 #

[View source]
def read(slice : Bytes) #

Does nothing but must be implemented since Crystal does not differentiate between Writesr/Readers


[View source]
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"

[View source]