org.pf.net
Class BinarySocketConnection

java.lang.Object
  extended by org.pf.util.ExceptionIgnorer
      extended by org.pf.net.SocketConnection
          extended by org.pf.net.BinarySocketConnection

public class BinarySocketConnection
extends SocketConnection

Receives binary data from a socket and provides it to a request processor by the getData() method

Version:
1.1
Author:
Manfred Duchrow

Constructor Summary
BinarySocketConnection(java.net.Socket openSocket)
           
BinarySocketConnection(java.net.Socket openSocket, ExceptionHandler exHandler)
           
 
Method Summary
 void close()
          Close the connection and all release underlying resources.
 byte[] getData()
          Tries to read data from the underlying input stream.
 boolean writeData(byte[] bytes)
          Writes the given data to the underlying output stream
 
Methods inherited from class org.pf.net.SocketConnection
isClosed, isOpen
 
Methods inherited from class org.pf.util.ExceptionIgnorer
exceptionOccurred, getExceptionHandler, setExceptionHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinarySocketConnection

public BinarySocketConnection(java.net.Socket openSocket)
Parameters:
openSocket - The socket this connection is based on

BinarySocketConnection

public BinarySocketConnection(java.net.Socket openSocket,
                              ExceptionHandler exHandler)
Parameters:
openSocket - The socket this connection is based on
exHandler - The exception handler for this connection
Method Detail

getData

public byte[] getData()
Tries to read data from the underlying input stream. Blocks until some data comes in and then returns it as a byte array.


writeData

public boolean writeData(byte[] bytes)
Writes the given data to the underlying output stream


close

public void close()
Close the connection and all release underlying resources.

Overrides:
close in class SocketConnection