class RemiLib::Compression::BZip2::Reader

Overview

A read-only IO object to decompress data in the bzip2 format.

Instances of this class wrap another IO object. When you read from this instance instance, it reads data from the underlying IO, decompresses it, and returns it to the caller.

Example of a simple decompressor:

# Decompress from `file` and save to `output`.
File.open(bzip2file, "rb") do |file|
  File.open(outputfile, "wb") do |output|
    RemiLib::Compression::BZip2::Reader.open(file) do |bzio|
      IO.copy(bzio, output)
    end
  end
end

Included Modules

Defined in:

remilib/compression/bzip/reader.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class IO

endBold : self endBold, endColor : self endColor, endConceal : self endConceal, endCrossedOut : self endCrossedOut, endEncircled : self endEncircled, endFaint : self endFaint, endFastBlink : self endFastBlink, endFraktur : self endFraktur, endFramed : self endFramed, endItalic : self endItalic, endOverlined : self endOverlined, endReverseVideo : self endReverseVideo, endSlowBlink : self endSlowBlink, endUnderline : self endUnderline, readBytes(count : Int) : Bytes readBytes, readFloat32 readFloat32, readFloat32BE readFloat32BE, readFloat64 readFloat64, readFloat64BE readFloat64BE, readInt128 readInt128, readInt128BE readInt128BE, readInt16 readInt16, readInt16BE readInt16BE, readInt24 readInt24, readInt24BE readInt24BE, readInt32 readInt32, readInt32BE readInt32BE, readInt64 readInt64, readInt64BE readInt64BE, readInt8 readInt8, readUInt128 readUInt128, readUInt128BE readUInt128BE, readUInt16 readUInt16, readUInt16BE readUInt16BE, readUInt32 readUInt32, readUInt32BE readUInt32BE, readUInt64 readUInt64, readUInt64BE readUInt64BE, readUInt8 readUInt8, startBold : self startBold, startColor(fg : RemiLib::Console::Color, bg : RemiLib::Console::Color = RemiLib::Console::Color::Default) : self startColor, startConceal : self startConceal, startCrossedOut : self startCrossedOut, startEncircled : self startEncircled, startFaint : self startFaint, startFastBlink : self startFastBlink, startFraktur : self startFraktur, startFramed : self startFramed, startItalic : self startItalic, startOverlined : self startOverlined, startReverseVideo : self startReverseVideo, startSlowBlink : self startSlowBlink, startUnderline : self startUnderline, withBold(&) withBold, withColor(fg : RemiLib::Console::Color, bg : RemiLib::Console::Color = RemiLib::Console::Color::Default, &) : self withColor, withConceal(&) withConceal, withCrossedOut(&) withCrossedOut, withEncircled(&) withEncircled, withExcursion(gotoHere, &)
withExcursion(&)
withExcursion
, withFaint(&) withFaint, withFastBlink(&) withFastBlink, withFraktur(&) withFraktur, withFramed(&) withFramed, withItalic(&) withItalic, withOverlined(&) withOverlined, withReverseVideo(&) withReverseVideo, withSlowBlink(&) withSlowBlink, withUnderline(&) withUnderline, writeFloat32(value : Float32) : self writeFloat32, writeFloat32BE(value : Float32) : self writeFloat32BE, writeFloat64(value : Float64) : self writeFloat64, writeFloat64BE(value : Float64) : self writeFloat64BE, writeInt128(value : Int128) : self writeInt128, writeInt128BE(value : Int128) : self writeInt128BE, writeInt16(value : Int16) : self writeInt16, writeInt16BE(value : Int16) : self writeInt16BE, writeInt24(data : Int32) writeInt24, writeInt24BE(data : Int32) writeInt24BE, writeInt32(value : Int32) : self writeInt32, writeInt32BE(value : Int32) : self writeInt32BE, writeInt64(value : Int64) : self writeInt64, writeInt64BE(value : Int64) : self writeInt64BE, writeInt8(value : Int8) : Nil writeInt8, writeUInt128(value : UInt128) : self writeUInt128, writeUInt128BE(value : UInt128) : self writeUInt128BE, writeUInt16(value : UInt16) : self writeUInt16, writeUInt16BE(value : UInt16) : self writeUInt16BE, writeUInt32(value : UInt32) : self writeUInt32, writeUInt32BE(value : UInt32) : self writeUInt32BE, writeUInt64(value : UInt64) : self writeUInt64, writeUInt64BE(value : UInt64) : self writeUInt64BE, writeUInt8(value : UInt8) : Nil writeUInt8

Class methods inherited from class IO

readBytes(io : IO, count : Int) : Bytes readBytes, readFloat32(io : IO) : Float32 readFloat32, readFloat32BE(io : IO) : Float32 readFloat32BE, readFloat64(io : IO) : Float64 readFloat64, readFloat64BE(io : IO) : Float64 readFloat64BE, readInt128(io : IO) : Int128 readInt128, readInt128BE(io : IO) : Int128 readInt128BE, readInt16(io : IO) : Int16 readInt16, readInt16BE(io : IO) : Int16 readInt16BE, readInt24(io : IO) : Int32 readInt24, readInt24BE(io : IO) : Int32 readInt24BE, readInt32(io : IO) : Int32 readInt32, readInt32BE(io : IO) : Int32 readInt32BE, readInt64(io : IO) : Int64 readInt64, readInt64BE(io : IO) : Int64 readInt64BE, readInt8(io : IO) : Int8 readInt8, readUInt128(io : IO) : UInt128 readUInt128, readUInt128BE(io : IO) : UInt128 readUInt128BE, readUInt16(io : IO) : UInt16 readUInt16, readUInt16BE(io : IO) : UInt16 readUInt16BE, readUInt32(io : IO) : UInt32 readUInt32, readUInt32BE(io : IO) : UInt32 readUInt32BE, readUInt64(io : IO) : UInt64 readUInt64, readUInt64BE(io : IO) : UInt64 readUInt64BE, readUInt8(io : IO) : UInt8 readUInt8, writeInt8(io : IO, value : Int8) : Nil writeInt8, writeUInt8(io : IO, value : UInt8) : Nil writeUInt8

Constructor Detail

def self.new(io : IO, sync_close : Bool = false) #

Creates an instance of Flate::Reader.


[View source]

Class Method Detail

def self.open(io : IO, sync_close : Bool = false, &) #

Creates a new reader from the given io, yields it to the given block, and closes it at its end.


[View source]

Instance Method Detail

def closed? : Bool #

Returns true if this reader is closed.


[View source]
def inspect(io : IO) : Nil #
Description copied from class Reference

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>

[View source]
def sync_close=(sync_close : Bool) #

If #sync_close? is true, closing this IO will close the underlying IO.


[View source]
def sync_close? : Bool #

If #sync_close? is true, closing this IO will close the underlying IO.


[View source]
def unbuffered_close : Nil #

Closes this reader.


[View source]
def unbuffered_flush : NoReturn #
Description copied from module IO::Buffered

Flushes the wrapped IO.

TODO Add return type restriction Nil


[View source]
def unbuffered_read(slice : Bytes) : Int32 #

See IO#read.


[View source]
def unbuffered_rewind : Nil #
Description copied from module IO::Buffered

Rewinds the wrapped IO.

TODO Add return type restriction Nil


[View source]
def unbuffered_write(slice : Bytes) : NoReturn #

Always raises IO::Error because this is a read-only IO.


[View source]