class Net::BufferedIO

Public Class Methods

new(io,debug_output = nil) click to toggle source
# File lib/warc/ext/net_http.rb, line 7
def initialize(io,debug_output = nil)
  @read_timeout = 60
  @rbuf = ''
  @debug_output = debug_output

  @io = case io
  when Socket, OpenSSL::SSL::SSLSocket, StringIO, IO
    io
  when String
    if !io.include?("\0") && File.exists?(io) && !File.directory?(io)
      File.open(io, "r")
    else
      StringIO.new(io)
    end
  end
  raise "Unable to create fake socket from #{io}" unless @io
end