com.caucho.quercus.lib.file
Class UdpInputOutput

java.lang.Object
  extended by com.caucho.quercus.lib.file.AbstractBinaryInputOutput
      extended by com.caucho.quercus.lib.file.UdpInputOutput
All Implemented Interfaces:
EnvCleanup, BinaryInput, BinaryOutput, BinaryStream, SocketInputOutput

public class UdpInputOutput
extends AbstractBinaryInputOutput
implements SocketInputOutput

Represents read/write stream


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.caucho.quercus.lib.file.SocketInputOutput
SocketInputOutput.Domain
 
Field Summary
 
Fields inherited from class com.caucho.quercus.lib.file.AbstractBinaryInputOutput
_env, _isEOF, _isTimeout, _lineReader
 
Fields inherited from interface com.caucho.quercus.lib.file.BinaryStream
SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
UdpInputOutput(Env env, java.net.DatagramSocket socket, SocketInputOutput.Domain domain)
           
UdpInputOutput(Env env, java.lang.String host, int port, SocketInputOutput.Domain domain)
           
 
Method Summary
 void bind(java.net.SocketAddress address)
           
 void cleanup()
          Implements the EnvCleanup interface.
 void connect(java.net.SocketAddress address)
           
 long getPosition()
          Returns the current location in the file.
 void init()
           
 void setError(int error)
           
 boolean setPosition(long offset)
          Sets the current location in the file.
 void setTimeout(long timeout)
           
 java.lang.String toString()
          Converts to a string.
 void unread()
          Unread the last byte.
 
Methods inherited from class com.caucho.quercus.lib.file.AbstractBinaryInputOutput
appendTo, close, closeRead, closeWrite, flush, getEnv, getInputStream, getOutputStream, getResourceType, init, isEOF, isTimeout, openCopy, print, print, read, read, read, readLine, readOptionalLinefeed, seek, stat, toJavaObject, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryInput
appendTo, close, closeRead, getInputStream, openCopy, read, read, read, readLine, readOptionalLinefeed
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryOutput
close, closeWrite, flush, getOutputStream, print, print, write, write
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryStream
isEOF, seek, stat
 

Constructor Detail

UdpInputOutput

public UdpInputOutput(Env env,
                      java.lang.String host,
                      int port,
                      SocketInputOutput.Domain domain)
               throws java.io.IOException
Throws:
java.io.IOException

UdpInputOutput

public UdpInputOutput(Env env,
                      java.net.DatagramSocket socket,
                      SocketInputOutput.Domain domain)
Method Detail

bind

public void bind(java.net.SocketAddress address)
          throws java.io.IOException
Specified by:
bind in interface SocketInputOutput
Throws:
java.io.IOException

connect

public void connect(java.net.SocketAddress address)
             throws java.io.IOException
Specified by:
connect in interface SocketInputOutput
Throws:
java.io.IOException

init

public void init()
Specified by:
init in interface SocketInputOutput

setTimeout

public void setTimeout(long timeout)
Specified by:
setTimeout in interface SocketInputOutput
Overrides:
setTimeout in class AbstractBinaryInputOutput

setError

public void setError(int error)
Specified by:
setError in interface SocketInputOutput

getPosition

public long getPosition()
Returns the current location in the file.

Specified by:
getPosition in interface BinaryInput
Specified by:
getPosition in interface BinaryStream
Specified by:
getPosition in class AbstractBinaryInputOutput

setPosition

public boolean setPosition(long offset)
Sets the current location in the file.

Specified by:
setPosition in interface BinaryInput
Specified by:
setPosition in interface BinaryStream
Specified by:
setPosition in class AbstractBinaryInputOutput

unread

public void unread()
            throws java.io.IOException
Unread the last byte.

Specified by:
unread in interface BinaryInput
Specified by:
unread in class AbstractBinaryInputOutput
Throws:
java.io.IOException

cleanup

public void cleanup()
Implements the EnvCleanup interface.

Specified by:
cleanup in interface EnvCleanup

toString

public java.lang.String toString()
Description copied from class: AbstractBinaryInputOutput
Converts to a string.

Overrides:
toString in class AbstractBinaryInputOutput