class IO::WideHexdump

Defined in:

shatter/data.cr

Constructors

Instance Method Summary

Instance methods inherited from class IO

read_angle : Float64 read_angle, read_bool : Bool read_bool, read_f32 : Float32 read_f32, read_f64 : Float64 read_f64, read_i16 : Int16 read_i16, read_i32 : Int32 read_i32, read_i64 : Int64 read_i64, read_i8 : Int8 read_i8, read_n_bytes(size : Int) : Bytes read_n_bytes, read_u16 : UInt16 read_u16, read_u32 : UInt32 read_u32, read_u64 : UInt64 read_u64, read_u8 : UInt8 read_u8, read_uuid : UUID read_uuid, read_var_int : UInt32 read_var_int, read_var_long : UInt64 read_var_long, read_var_string : String read_var_string, write_bool(i : Bool) : Nil write_bool, write_f32(i : Float32) : Nil write_f32, write_f64(i : Float64) : Nil write_f64, write_i16(i : Int16) : Nil write_i16, write_i32(i : Int32) : Nil write_i32, write_i64(i : Int64) : Nil write_i64, write_i8(i : Int8) : Nil write_i8, write_u16(i : UInt16) : Nil write_u16, write_u32(i : UInt32) : Nil write_u32, write_u64(i : UInt64) : Nil write_u64, write_u8(i : UInt8) : Nil write_u8, write_var_int(value : Int32) : Nil
write_var_int(value : UInt32) : Nil
write_var_int
, write_var_string(s : String) : Nil write_var_string

Constructor Detail

def self.new(io : IO, output : IO = STDERR, read : Bool = false, write : Bool = false) #

[View source]

Instance Method Detail

def close(*args, **options) #

[View source]
def close(*args, **options, &) #

[View source]
def closed?(*args, **options) #

[View source]
def closed?(*args, **options, &) #

[View source]
def flush(*args, **options) #

[View source]
def flush(*args, **options, &) #

[View source]
def peek(*args, **options) #

[View source]
def peek(*args, **options, &) #

[View source]
def pos(*args, **options) #

[View source]
def pos(*args, **options, &) #

[View source]
def pos=(arg) #
Description copied from class IO

Sets the current position (in bytes) in this IO.

The IO class raises on this method, but some subclasses, notable IO::FileDescriptor and IO::Memory implement it.

File.write("testfile", "hello")

file = File.new("testfile")
file.pos = 3
file.gets_to_end # => "lo"

[View source]
def read(buf : Bytes) : Int32 #
Description copied from class IO

Reads at most slice.size bytes from this IO into slice. Returns the number of bytes read, which is 0 if and only if there is no more data to read (so checking for 0 is the way to detect end of file).

io = IO::Memory.new "hello"
slice = Bytes.new(4)
io.read(slice) # => 4
slice          # => Bytes[104, 101, 108, 108]
io.read(slice) # => 1
slice          # => Bytes[111, 101, 108, 108]
io.read(slice) # => 0

[View source]
def seek(*args, **options) #

[View source]
def seek(*args, **options, &) #

[View source]
def tty?(*args, **options) #

[View source]
def tty?(*args, **options, &) #

[View source]
def write(buf : 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]