Order the Book

Class SocketUtil

java.lang.Object
  |
  +--SocketUtil

public class SocketUtil
extends Object

A shorthand way to create BufferedReaders and PrintWriters associated with a Socket.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.


Constructor Summary
SocketUtil()
           
 
Method Summary
static BufferedReader getReader(Socket s)
          Make a BufferedReader to get incoming data.
static PrintWriter getWriter(Socket s)
          Make a PrintWriter to send outgoing data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketUtil

public SocketUtil()
Method Detail

getReader

public static BufferedReader getReader(Socket s)
                                throws IOException
Make a BufferedReader to get incoming data.

getWriter

public static PrintWriter getWriter(Socket s)
                             throws IOException
Make a PrintWriter to send outgoing data. This PrintWriter will automatically flush stream when println is called.

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive