import java.io.*;
class MyBufferedInputStream
{
private InputStream in;
private byte[] arr = new byte[1024*4];
private int pos=0,count=0;
MyBufferedInputStream(InputStream in)
{
this.in = in;
}
public int myRead()throws IOException
{
if(count==0)
{
count = in.read(arr);
if(count<0)
return -1;
pos = 0;
byte b = arr[pos];
// System.out.println("b="+b);
pos++;
count--;
return b&255;
}
else if(count>0)
{
byte b = arr[pos];
// System.out.println("b=="+b);
pos++;
count--;
return b&0xff;
}
return -1;
}
public void myClose()throws IOException
{
in.close();
}
}
/*
byte -1
11111111
int -1
11111111 11111111 11111111 11111111
00000000 00000000 00000000 11111111
*/