Class: JavaClass::ArrayIO
- Inherits:
-
Object
- Object
- JavaClass::ArrayIO
- Defined in:
- lib/javaclass/reader.rb
Overview
byte配列をIOに見せかける。
Instance Method Summary collapse
- #getc ⇒ Object
-
#initialize(array) ⇒ ArrayIO
constructor
A new instance of ArrayIO.
- #read(length) ⇒ Object
Constructor Details
#initialize(array) ⇒ ArrayIO
Returns a new instance of ArrayIO.
10 11 12 |
# File 'lib/javaclass/reader.rb', line 10 def initialize( array ) @array = array end |
Instance Method Details
#getc ⇒ Object
13 14 15 |
# File 'lib/javaclass/reader.rb', line 13 def getc @array.shift end |
#read(length) ⇒ Object
16 17 18 |
# File 'lib/javaclass/reader.rb', line 16 def read(length) @array.slice!(0, length).pack("C*") end |