class Compress::LZ4::IO
- Compress::LZ4::IO
- IO
- Reference
- Object
Defined in:
lz4/io.crConstructors
Instance Method Summary
-
#close
Ends the current LZ4 frame, the stream can still be written to, unless @sync_close
-
#closed? : Bool
Returns
true
if thisIO
is closed. - #compressed_bytes_in : UInt64
- #compressed_bytes_out : UInt64
- #finalize
-
#flush : Nil
Flush LZ4 lib buffers even if a block isn't full
- #local_address : Socket::Address
- #local_address=(local_address : Socket::Address)
- #local_address? : Socket::Address | Nil
-
#read(slice : Bytes) : Int32
Reads at most slice.size bytes from this
IO
into slice. - #remote_address : Socket::Address
- #remote_address=(remote_address : Socket::Address)
- #remote_address? : Socket::Address | Nil
-
#rewind
Rewinds this
IO
. - #sync_close=(sync_close : Bool)
- #sync_close? : Bool
- #uncompressed_bytes_in : UInt64
- #uncompressed_bytes_out : UInt64
-
#write(slice : Bytes) : Nil
Writes the contents of slice into this
IO
.
Constructor Detail
Instance Method Detail
def closed? : Bool
#
Description copied from class IO
Returns true
if this IO
is closed.
IO
defines returns false
, but including types may override.
def read(slice : 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
def rewind
#
Description copied from class IO
Rewinds this IO
. By default this method raises, but including types
may implement it.