class ZipTricks::CRC32Writer

Defined in:

crc32_writer.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(io : IO) #

[View source]

Instance Method Detail

def count : UInt32 #

[View source]
def crc32 : UInt32 #

[View source]
def io : IO #

[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]