Sha256: fe3a5423f1219d40417c50f8dbc97c51ce51bc50983739fd8e8f3209648fa78e

Contents?: true

Size: 283 Bytes

Versions: 3

Compression:

Stored size: 283 Bytes

Contents

class File

  # Read in a file as binary data.
  #
  # Assuming we had a binary file 'tmp/binary.dat'.
  #
  #   File.read_binary('tmp/binary.dat')
  #
  # CREDIT: George Moschovitis

  def self.read_binary(fname)
    open(fname, 'rb') do |f|
      return f.read
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-2.9.0 lib/core/facets/file/read_binary.rb
facets-2.9.0.pre.2 lib/core/facets/file/read_binary.rb
facets-2.9.0.pre.1 lib/core/facets/file/read_binary.rb