Class: Zip::PassThruCompressor

Inherits:
Compressor show all
Defined in:
lib/zip/zip.rb

Overview

:nodoc:all

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Compressor

#finish

Constructor Details

- (PassThruCompressor) initialize(outputStream)



1068
1069
1070
1071
1072
1073
# File 'lib/zip/zip.rb', line 1068

def initialize(outputStream)
  super()
  @outputStream = outputStream
  @crc = Zlib::crc32
  @size = 0
end

Instance Attribute Details

- (Object) crc (readonly)

Returns the value of attribute crc



1082
1083
1084
# File 'lib/zip/zip.rb', line 1082

def crc
  @crc
end

- (Object) size (readonly)

Returns the value of attribute size



1082
1083
1084
# File 'lib/zip/zip.rb', line 1082

def size
  @size
end

Instance Method Details

- (Object) <<(data)



1075
1076
1077
1078
1079
1080
# File 'lib/zip/zip.rb', line 1075

def << (data)
  val = data.to_s
  @crc = Zlib::crc32(val, @crc)
  @size += val.size
  @outputStream << val
end