入出力をつなげる


public void pipe(InputStream in, OutputStream out) throws IOException {
byte[] buf = new byte[256];

while (in.available() > 0) {
int len = in.read(buf);
out.write(buf, 0, len);
}
}

ByteArrayInputStream/ByteArrayOutputStreamではうまくいったけど、他でもうまくいくかな?