Class: EventMachine::RTMP::Buffer

Inherits:
StringIO
  • Object
show all
Includes:
IOHelpers
Defined in:
lib/em-rtmp/buffer.rb

Instance Method Summary collapse

Methods included from IOHelpers

#read_bitfield, #read_double_be, #read_int29, #read_safe, #read_uint16_be, #read_uint24_be, #read_uint32_be, #read_uint32_le, #read_uint8, #write_bitfield, #write_double_be, #write_int29, #write_uint16_be, #write_uint24_be, #write_uint32_be, #write_uint32_le, #write_uint8

Instance Method Details

#append(string) ⇒ Object

Append to the end of the string without changing our position

Returns nothing



27
28
29
# File 'lib/em-rtmp/buffer.rb', line 27

def append(string)
  self.string << string
end

#remainingObject

Gets the number of remaining bytes in the buffer

Returns an Integer representing the number of bytes left



12
13
14
# File 'lib/em-rtmp/buffer.rb', line 12

def remaining
  length - pos
end

#resetObject

Truncate the buffer to nothing and set the position to zero

Returns the new position (zero)



19
20
21
22
# File 'lib/em-rtmp/buffer.rb', line 19

def reset
  truncate 0
  seek 0
end