Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- class IOUtilities {
- public void copyInto(InputStream input, OutputStream output) throws FileNotFoundException, IOException
- {
- long size = ((FileInputStream)input).getChannel().size();
- for (long i = 0; i < size; i++)
- output.write(input.read());
- output.close();
- input.close();
- }
- public void copyInto2(Reader input, Writer output) throws IOException
- {
- int b = input.read();
- while (b != -1)
- {
- output.write(b);
- b = input.read();
- }
- input.close();
- output.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement