Created
September 17, 2010 03:55
-
-
Save dekz/583659 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Medium files - write 9000000 bytes | |
| bm.bench(new Runnable() { | |
| public void run() { | |
| try { | |
| InputStream in = new BufferedInputStream(new FileInputStream("test")); | |
| OutputStream out = new BufferedOutputStream(new FileOutputStream("out")); | |
| int i; | |
| byte[] buffer = new byte[1024]; | |
| while ((i = in.read(buffer, 0, 1024)) != -1) { | |
| out.write(buffer, 0, i); | |
| } | |
| out.close(); | |
| in.close(); | |
| } catch (Exception e) { | |
| e.printStackTrace(); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment