Java / InputStream/OutputStream - Copier
Posted 2007/11/21 10:32, Filed under: 프로그래밍/Java
import java.io.*;
public class Copier
{
protected InputStream in;
protected OutputStream out;
protected byte data[];
public Copier(InputStream in, OutputStream out, int sz)
{
this.in = in;
this.out = out;
data = new byte[sz];
}
public Copier(InputStream in, OutputStream out)
{
this(in, out, 1024);
}
public void copy() throws IOException
{
int n=0;
while ((n = in.read(data)) != -1)
{
out.write(data, 0, n);
}
in.close();
out.close();
}
}
Response :
0 Trackback
,
0 Comment
Trackback URL : http://mysilpir.net/trackback/281



