Advertisement
Guest User

Utils class

a guest
Jan 5th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1.  
  2.  
  3. import java.io.InputStream;
  4. import java.io.OutputStream;
  5.  
  6. public class Utils {
  7. public static void CopyStream(InputStream is, OutputStream os)
  8. {
  9. final int buffer_size=1024;
  10. try
  11. {
  12. byte[] bytes=new byte[buffer_size];
  13. for(;;)
  14. {
  15. int count=is.read(bytes, 0, buffer_size);
  16. if(count==-1)
  17. break;
  18. os.write(bytes, 0, count);
  19. }
  20. }
  21. catch(Exception ex){}
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement