com.caucho.quercus.lib.file
Class SocketInputOutput

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

public class SocketInputOutput
extends AbstractBinaryInputOutput
implements EnvCleanup

Represents read/write stream


Nested Class Summary
static class SocketInputOutput.Domain
           
 
Field Summary
 
Fields inherited from interface com.caucho.quercus.lib.file.BinaryStream
SEEK_CUR, SEEK_END, SEEK_SET
 
Constructor Summary
SocketInputOutput(Env env, java.net.Socket socket, SocketInputOutput.Domain domain)
           
 
Method Summary
 void bind(java.net.SocketAddress address)
           
 void cleanup()
          Implements the EnvCleanup interface.
 void close()
          Closes the stream.
 void connect(java.net.SocketAddress address)
           
 void init()
           
 void setError(int error)
           
 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.AbstractBinaryInputOutput
appendTo, closeRead, closeWrite, flush, getEnv, getInputStream, getOutputStream, getPosition, getResourceType, init, isEOF, openCopy, print, print, read, read, read, read, readLine, readOptionalLinefeed, seek, setEncoding, setPosition, stat, toJavaObject, unread, writeToStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketInputOutput

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

bind

public void bind(java.net.SocketAddress address)
          throws java.io.IOException
Throws:
java.io.IOException

connect

public void connect(java.net.SocketAddress address)
             throws java.io.IOException
Throws:
java.io.IOException

setError

public void setError(int error)

init

public void init()

setTimeout

public void setTimeout(long timeout)
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)
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

close

public void close()
Closes the stream.

Specified by:
close in interface BinaryInput
Specified by:
close in interface BinaryOutput
Specified by:
close in interface BinaryStream
Overrides:
close in class AbstractBinaryInputOutput

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