Class: Wiris::Bytes
- Inherits:
-
Object
- Object
- Wiris::Bytes
- Defined in:
- lib/src-generic/Bytes.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bytes ⇒ Object
- #bytes=(bytes) ⇒ Object
- #get(index) ⇒ Object
- #getData ⇒ Object
-
#initialize(bytes) ⇒ Bytes
constructor
A new instance of Bytes.
- #length ⇒ Object
- #toString ⇒ Object
Constructor Details
#initialize(bytes) ⇒ Bytes
Returns a new instance of Bytes.
16 17 18 |
# File 'lib/src-generic/Bytes.rb', line 16 def initialize(bytes) @bytes = bytes end |
Class Method Details
.alloc(int) ⇒ Object
37 38 39 |
# File 'lib/src-generic/Bytes.rb', line 37 def self.alloc(int) return [] end |
Instance Method Details
#bytes ⇒ Object
12 13 14 |
# File 'lib/src-generic/Bytes.rb', line 12 def bytes @bytes end |
#bytes=(bytes) ⇒ Object
9 10 11 |
# File 'lib/src-generic/Bytes.rb', line 9 def bytes=(bytes) @bytes=bytes end |
#get(index) ⇒ Object
33 34 35 |
# File 'lib/src-generic/Bytes.rb', line 33 def get(index) return @bytes[index] end |
#getData ⇒ Object
29 30 31 |
# File 'lib/src-generic/Bytes.rb', line 29 def getData() return @bytes end |
#length ⇒ Object
41 42 43 |
# File 'lib/src-generic/Bytes.rb', line 41 def length() return @bytes.length end |
#toString ⇒ Object
45 46 47 |
# File 'lib/src-generic/Bytes.rb', line 45 def toString() return @bytes.pack('c*').force_encoding("ISO-8859-1") end |