Module: IOExtras::AbstractOutputStream

### Home Classes Methods

### In Files

- lib/zip/ioextras.rb

### Methods

- #print
- #printf
- #putc
- #puts
- #write

### Included Modules

- IOExtras::FakeIO

### Class/Module Index

Quicksearch

- Zip
- Zip::ZipCentralDirectory
- Zip::ZipCompressionMethodError
- Zip::ZipDestinationFileExistsError
- Zip::ZipEntry
- Zip::ZipEntryExistsError
- Zip::ZipEntryNameError
- Zip::ZipError
- Zip::ZipExtraField
- Zip::ZipExtraField::Generic
- Zip::ZipExtraField::IUnix
- Zip::ZipExtraField::UniversalTime
- Zip::ZipFile
- Zip::ZipFileSystem
- Zip::ZipFileSystem::ZipFsDir
- Zip::ZipFileSystem::ZipFsFile
- Zip::ZipFileSystem::ZipFsFile::ZipFsStat
- Zip::ZipInputStream
- Zip::ZipInternalError
- Zip::ZipOutputStream
- Zip::ZipStreamableDirectory
- Zip::ZipStreamableStream
- IOExtras
- IOExtras::AbstractInputStream
- IOExtras::AbstractOutputStream
- IOExtras::FakeIO
- BugFix
- Object

No matching classes.

# IOExtras::AbstractOutputStream

Implements many of the output convenience methods of IO. relies on <<

### Public Instance Methods

print(*params) click to toggle source

    # File lib/zip/ioextras.rb, line 130
    def print(*params)
      self << params.join($,) << $\.to_s
    end

printf(aFormatString, *params) click to toggle source

    # File lib/zip/ioextras.rb, line 134
    def printf(aFormatString, *params)
      self << sprintf(aFormatString, *params)
    end

putc(anObject) click to toggle source

    # File lib/zip/ioextras.rb, line 138
    def putc(anObject)
      self << case anObject
      when Fixnum then anObject.chr
      when String then anObject
      else raise TypeError, "putc: Only Fixnum and String supported"
      end
      anObject
    end

puts(*params) click to toggle source

    # File lib/zip/ioextras.rb, line 147
    def puts(*params)
      params << "\n" if params.empty?
      params.flatten.each do |element|
        val = element.to_s
        self << val
        self << "\n" unless val[-1,1] == "\n"
      end
    end

write(data) click to toggle source

    # File lib/zip/ioextras.rb, line 124
    def write(data)
      self << data
      data.to_s.bytesize
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.