class MyBufferedInputStream
{
private InputStream in;
private int count=0;
private int pos=0;
private byte[] by = new byte[1024];
MyBufferedInputStream(InputStream in)
{
this.in=in;
}
public int myBufferedRead()throws IOException
{
public class MyStringBufferDemo
{
public static void main(String[] args)throws IOException
{
MyBufferedInputStream mbs = new MyBufferedInputStream(new FileInputStream("xuexi.jpg"));
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("xuexi2.jpg"));
int num =0;
while((num=mbs.myBufferedRead())!=-1)
{
bos.write(num);
}
mbs.myclose();
bos.close();
}
}