class Wiris::BytesInput

Public Class Methods

new(bs) click to toggle source
# File lib/src-generic/BytesInput.rb, line 7
def initialize(bs)
        @binary = bs.getData().to_enum
end

Public Instance Methods

binary() click to toggle source
# File lib/src-generic/BytesInput.rb, line 3
def binary()
        @binary
end
readByte() click to toggle source
# File lib/src-generic/BytesInput.rb, line 15
def readByte()
        byt = @binary.next
        if byt.nil?
                return false
        else
                return byt
        end
end
readBytes(b, pos, len) click to toggle source
# File lib/src-generic/BytesInput.rb, line 11
def readBytes(b, pos, len)
        return @binary[pos..len]
end
readInt32() click to toggle source
# File lib/src-generic/BytesInput.rb, line 23
def readInt32()
        c1 = readByte
        c2 = readByte
        c3 = readByte
        c4 = readByte
        return (c1 << 8 | c2) << 16 | (c3 << 8 | c4)
end