org.apache.commons.scaffold.http
Class SocketUtil
java.lang.Object
org.apache.commons.scaffold.http.SocketUtil
- public class SocketUtil
- extends java.lang.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.
|
Method Summary |
static java.io.BufferedReader |
getReader(java.net.Socket s)
Make a BufferedReader to get incoming data. |
static java.io.PrintWriter |
getWriter(java.net.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 |
SocketUtil
public SocketUtil()
getReader
public static java.io.BufferedReader getReader(java.net.Socket s)
throws java.io.IOException
- Make a BufferedReader to get incoming data.
- Throws:
java.io.IOException
getWriter
public static java.io.PrintWriter getWriter(java.net.Socket s)
throws java.io.IOException
- Make a PrintWriter to send outgoing data.
This PrintWriter will automatically flush stream
when println is called.
- Throws:
java.io.IOException
Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.