JPProxy update

This commit is contained in:
Jindra Petk
2011-07-16 12:40:49 +02:00
parent 991b08d8bc
commit 49a8fd03bf
24 changed files with 2419 additions and 1577 deletions

View File

@@ -1,25 +1,19 @@
package com.jpexs.proxy;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.*;
import java.net.Socket;
/**
* Client which reads a Request and writes a Reply.
*
* @author Mark Boyns
*/
public class Client extends Connection {
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);
Client(Socket s) throws IOException
{
super(s);
in = new BufferedInputStream(in);
//out = new DebugOutputStream(new BufferedOutputStream(out));
out = new BufferedOutputStream(out);
}
@@ -27,17 +21,22 @@ public class Client extends Connection {
* Read a Request.
*
* @returns a Request.
* @see Request
*/
Request read() throws IOException {
Request request = new Request(this);
request.read(getInputStream());
return request;
Request read() throws IOException
{
Request request = new Request(this);
request.read(getInputStream());
return request;
}
/**
* Write a Reply
*
* @see Reply
*/
void write(Reply reply) throws IOException {
reply.write(getOutputStream());
void write(Reply reply) throws IOException
{
reply.write(getOutputStream());
}
}
}