class Puma::IOBuffer
Constants
- BUF_DEFAULT_SIZE
Public Class Methods
new()
click to toggle source
# File lib/puma/java_io_buffer.rb, line 16 def initialize @buf = JavaIOBuffer.new(BUF_DEFAULT_SIZE) end
Public Instance Methods
<<(str)
click to toggle source
# File lib/puma/java_io_buffer.rb, line 24 def <<(str) bytes = str.to_java_bytes @buf.write(bytes, 0, bytes.length) end
append(*strs)
click to toggle source
# File lib/puma/java_io_buffer.rb, line 29 def append(*strs) strs.each { |s| self << s; } end
capacity()
click to toggle source
# File lib/puma/java_io_buffer.rb, line 43 def capacity @buf.buf.length end
reset()
click to toggle source
# File lib/puma/java_io_buffer.rb, line 20 def reset @buf.reset end
to_s()
click to toggle source
# File lib/puma/java_io_buffer.rb, line 33 def to_s String.from_java_bytes @buf.to_byte_array end
Also aliased as: to_str
used()
click to toggle source
# File lib/puma/java_io_buffer.rb, line 39 def used @buf.size end