require 'socket'
require 'stringio'
sock = TCPSocket.open("www.example.com", 80)
sock.write("GET /\n")
file = StringIO.new(sock.read)
file.read(10) # => "\r\n file.rewind
file.read(10) # => "\r\n file.pos = 90
file.read(15) # => " this web page "