system
Class NetworkUtil

java.lang.Object
  extended by system.NetworkUtil

public class NetworkUtil
extends java.lang.Object

Network utility functions. These are designed to be real simple methods that read and write Strings that end with '\n' from/to a SocketChannel.

Author:
sean

Constructor Summary
NetworkUtil()
           
 
Method Summary
static java.lang.String readMessage(java.nio.channels.SocketChannel channel)
          Network read message.
static void sendMessage(java.nio.channels.SocketChannel channel, java.lang.String message)
          Send message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkUtil

public NetworkUtil()
Method Detail

readMessage

public static java.lang.String readMessage(java.nio.channels.SocketChannel channel)
                                    throws java.io.IOException
Network read message.

Parameters:
channel -
Returns:
Throws:
java.io.IOException

sendMessage

public static void sendMessage(java.nio.channels.SocketChannel channel,
                               java.lang.String message)
                        throws java.io.IOException
Send message.

Parameters:
channel -
message -
Throws:
java.io.IOException