package fr.umlv.ji.io;
import java.net.*;
import java.io.*;
public class XORSocket extends Socket {
private int key;
private InputStream in = null;
private OutputStream out = null;
XORSocket(int key) throws IOException {
this.key = key;
}
public XORSocket(String host, int port, int key) throws IOException {
super(host, port);
this.key = key;
}
public InputStream getInputStream() throws IOException {
if (in!=null)
return in;
return new XORInputStream(super.getInputStream(),key);
}
public OutputStream getOutputStream() throws IOException {
if (out != null)
return out;
return new XOROutputStream(super.getOutputStream(), key);
}
}