Hi
the NVTInputStreamReader class i am using is as follows.
public class NVTInputStream extends FilterInputStream
{
byte IAC = (byte)0xff;
byte DO = (byte)0xfd;
byte WILL = (byte)0xfb;
int WONT = 252;
int DONT = 254;
OutputStream out;
int BUFFER_SIZE = 1024;
byte lineBuffer[] = new byte[BUFFER_SIZE];
int numBytes = 0;
public NVTInputStream(InputStream inStream, OutputStream outStream)
{
super(inStream);
out = outStream;
}
/**
* Following function takes each character from the socket
inputstream
* It returns each character as integer
*/
public int read() throws IOException {
boolean recIAC;
int i;
do {
recIAC = false;
i = in.read();
if (i==-1) return i;
byte b = (byte)i;
if (b==IAC) {
recIAC = true;
int cmd = in.read();
if (cmd==-1) return cmd;
byte b2 = (byte)cmd;
if (b2==IAC) return 255;
else if (b2==DO) {
int opt = in.read();
if(opt==-1) return opt;
out.write(255);
out.write(WONT);
out.write(opt);
out.flush();
}
else if (b2==WILL) {
int opt = in.read();
if(opt==-1) return opt;
out.write(255);
out.write(WONT);
out.write(opt);
out.flush();
}
}
} while (recIAC);
return i;
}
}
i am using this class to get the stream .i am
taking the integer conversion of stream and the cnverting to characters
..but some characters are seen missing.so if possible suggest me some
new character encoding measures.Thanks in advance