Class: Puma::IOBuffer

### Home Classes Methods

### In Files

- lib/puma/java_io_buffer.rb

### Parent

Object

### Methods

- ::new
- #<<
- #append
- #capacity
- #reset
- #to_s
- #to_str
- #used

### Files

- Manifest.txt

### Class/Module Index

Quicksearch

- Puma
- Puma::App
- Puma::App::Status
- Puma::Binder
- Puma::CLI
- Puma::Client
- Puma::Cluster
- Puma::Cluster::Worker
- Puma::CommonLogger
- Puma::ConfigDefault
- Puma::Configuration
- Puma::Configuration::ConfigMiddleware
- Puma::ConnectionError
- Puma::Const
- Puma::ControlCLI
- Puma::DSL
- Puma::Delegation
- Puma::Events
- Puma::Events::DefaultFormatter
- Puma::Events::PidFormatter
- Puma::IOBuffer
- Puma::JRubyRestart
- Puma::JavaIOBuffer
- Puma::MiniSSL
- Puma::MiniSSL::Context
- Puma::MiniSSL::SSLError
- Puma::MiniSSL::Server
- Puma::MiniSSL::Socket
- Puma::NullIO
- Puma::Rack
- Puma::Rack::Builder
- Puma::Rack::Options
- Puma::Rack::URLMap
- Puma::Reactor
- Puma::Runner
- Puma::Server
- Puma::Single
- Puma::TCPLogger
- Puma::ThreadPool
- Puma::ThreadPool::AutoTrim
- Puma::ThreadPool::Reaper
- Puma::UnsupportedOption
- Puma::Util
- Puma::Util::HeaderHash
- OpenSSL
- OpenSSL::SSL
- OpenSSL::SSL::SSLServer
- Rack
- Rack::Handler
- Rack::Handler::Puma
- IO
- IO::WaitReadable
- Object
- Process
- String

No matching classes.

# Puma::IOBuffer

### Constants

BUF_DEFAULT_SIZE

### Public Class Methods

new() click to toggle source

    # File lib/puma/java_io_buffer.rb, line 14
    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 22
    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 27
    def append(*strs)
      strs.each { |s| self << s; }
    end

capacity() click to toggle source

    # File lib/puma/java_io_buffer.rb, line 41
    def capacity
      @buf.buf.length
    end

reset() click to toggle source

    # File lib/puma/java_io_buffer.rb, line 18
    def reset
      @buf.reset
    end

to_s() click to toggle source

    # File lib/puma/java_io_buffer.rb, line 31
    def to_s
      String.from_java_bytes @buf.to_byte_array
    end

Also aliased as: to_str
to_str() click to toggle source
Alias for: to_s
used() click to toggle source

    # File lib/puma/java_io_buffer.rb, line 37
    def used
      @buf.size
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.