com.caucho.quercus.lib.file
Class TcpInputOutput

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

public class TcpInputOutput
extends BufferedBinaryInputOutput
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
TcpInputOutput(Env env, java.net.Socket socket, SocketInputOutput.Domain domain)
           
TcpInputOutput(Env env, java.lang.String host, int port, boolean isSecure, SocketInputOutput.Domain domain)
           
 
Method Summary
 void bind(java.net.SocketAddress address)
           
 void cleanup()
          Implements the EnvCleanup interface.
 void connect(java.net.SocketAddress address)
           
 int getError()
           
 void init()
           
 void setError(int errno)
           
 void setTimeout(long timeout)
           
 java.lang.String toString()
          Converts to a string.
 void write(byte[] buffer, int offset, int length)
          Writes a buffer.
 int write(java.io.InputStream is, int length)
          Read length bytes of data from the InputStream argument and write them to this output stream.
 void write(int ch)
           
 
Methods inherited from class com.caucho.quercus.lib.file.BufferedBinaryInputOutput
getPosition, init, read, read, readLine, setEncoding, setPosition, stat, unread, writeToStream
 
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, readOptionalLinefeed, seek, toJavaObject
 
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, getPosition, openCopy, read, read, read, readLine, readOptionalLinefeed, setPosition, unread
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryOutput
close, closeWrite, flush, getOutputStream, print, print
 
Methods inherited from interface com.caucho.quercus.lib.file.BinaryStream
isEOF, seek, stat
 

Constructor Detail

TcpInputOutput

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

TcpInputOutput

public TcpInputOutput(Env env,
                      java.net.Socket 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

setError

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

getError

public int getError()

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

write

public void write(int ch)
           throws java.io.IOException
Overrides:
write in class AbstractBinaryInputOutput
Throws:
java.io.IOException

write

public void write(byte[] buffer,
                  int offset,
                  int length)
           throws java.io.IOException
Description copied from interface: BinaryOutput
Writes a buffer.

Specified by:
write in interface BinaryOutput
Overrides:
write in class AbstractBinaryInputOutput
Throws:
java.io.IOException

write

public int write(java.io.InputStream is,
                 int length)
          throws java.io.IOException
Read length bytes of data from the InputStream argument and write them to this output stream.

Specified by:
write in interface BinaryOutput
Overrides:
write 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: BufferedBinaryInputOutput
Converts to a string.

Overrides:
toString in class BufferedBinaryInputOutput