Module: BinData::IO

Defined in:
lib/bindata/io.rb

Overview

A wrapper around an IO object. The wrapper provides a consistent interface for BinData objects to use when accessing the IO.

Defined Under Namespace

Classes: Read, Write

Class Method Summary collapse

Class Method Details

.create_string_io(str = "") ⇒ Object

Creates a StringIO around str.



8
9
10
# File 'lib/bindata/io.rb', line 8

def self.create_string_io(str = "")
  StringIO.new(str.dup.force_encoding(Encoding::BINARY))
end