Initial version based on previous work. (Version alpha 7)

This commit is contained in:
Jindra Petk
2010-09-04 13:57:22 +02:00
commit a34ee7364c
1147 changed files with 84884 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
package com.jpexs.proxy;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.Socket;
/**
* Client which reads a Request and writes a Reply.
*
* @author Mark Boyns
*/
public class Client extends Connection {
/**
* Create a Client from a Socket.
*/
Client(Socket s) throws IOException {
super(s);
in = new BufferedInputStream(in);
//out = new DebugOutputStream(new BufferedOutputStream(out));
out = new BufferedOutputStream(out);
}
/**
* Read a Request.
*
* @returns a Request.
*/
Request read() throws IOException {
Request request = new Request(this);
request.read(getInputStream());
return request;
}
/**
* Write a Reply
*/
void write(Reply reply) throws IOException {
reply.write(getOutputStream());
}
}