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
Class Method Summary collapse
-
.create_string_io(str = "") ⇒ Object
Creates a StringIO around
str
.
Class Method Details
.create_string_io(str = "") ⇒ Object
Creates a StringIO around str
.
8 9 10 11 12 13 |
# File 'lib/bindata/io.rb', line 8 def self.create_string_io(str = "") if str.respond_to?(:force_encoding) str = str.dup.force_encoding(Encoding::BINARY) end StringIO.new(str) end |