|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.simpleSockets.ClientSocket
A Socket Wrapper class.
Constructor Summary | |
ClientSocket(java.net.InetAddress addr,
int port)
|
|
ClientSocket(java.net.Socket sock)
|
|
ClientSocket(java.lang.String host,
int port)
|
|
ClientSocket(java.net.URL url,
int port)
|
Method Summary | |
void |
close()
|
protected void |
finalize()
|
java.io.BufferedInputStream |
getBufferedInputStream()
|
java.io.BufferedOutputStream |
getBufferedOutputStream()
|
java.net.Socket |
getSocket()
There just may be a need to get to the actual socket. |
static void |
main(java.lang.String[] args)
Methods to test client socket. |
int |
readInt()
|
java.lang.Object |
readObject()
|
void |
readOntoStream(java.io.OutputStream outStream)
Read an unknown amount of bytes from the socket and write them onto the provided output stream. |
java.lang.String |
readString()
I could have used readUTF, but this implementation allows for lengths requiring 4 bytes. |
void |
testSocketStuff()
|
void |
write(byte[] b,
int off,
int len)
|
void |
writeByte(int data)
|
void |
writeFromStream(java.io.InputStream inStream)
Read from the provided input stream and write the results on the socket. |
void |
writeInt(int data)
|
void |
writeObject(java.lang.Object obj)
|
void |
writeString(java.lang.String dataString)
|
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClientSocket(java.lang.String host, int port) throws java.io.IOException
public ClientSocket(java.net.InetAddress addr, int port) throws java.io.IOException
public ClientSocket(java.net.Socket sock) throws java.io.IOException
public ClientSocket(java.net.URL url, int port) throws java.io.IOException
Method Detail |
public java.net.Socket getSocket()
public java.io.BufferedOutputStream getBufferedOutputStream()
public java.io.BufferedInputStream getBufferedInputStream()
public void close() throws java.io.IOException
java.io.IOException
protected void finalize() throws java.io.IOException
finalize
in class java.lang.Object
java.io.IOException
public static void main(java.lang.String[] args)
public int readInt() throws java.io.IOException
java.io.IOException
public java.lang.Object readObject() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void readOntoStream(java.io.OutputStream outStream) throws java.io.IOException
java.io.IOException
public java.lang.String readString() throws java.io.IOException
java.io.IOException
public void testSocketStuff()
public void write(byte[] b, int off, int len) throws java.io.IOException
java.io.IOException
public void writeByte(int data) throws java.io.IOException
java.io.IOException
public void writeFromStream(java.io.InputStream inStream) throws java.io.IOException
java.io.IOException
public void writeInt(int data) throws java.io.IOException
java.io.IOException
public void writeObject(java.lang.Object obj) throws java.io.IOException
java.io.IOException
public void writeString(java.lang.String dataString) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |