If you use an InputStream to read, use an OutputStream to write, i.e. a BufferedOutputStream-wrapped FileOutputStream. Also, your code is pretty inefficient, as it only copies one byte at a time. I'd suggest creating a byte array buffer and using these relevant read/write methods:
int BufferedInputStream.read(byte[] buffer, int offset, int length)
void BufferedOutputStream.write(byte[] buffer, int offset, int length)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…