Created
September 25, 2013 19:37
-
-
Save dwelch2344/6704913 to your computer and use it in GitHub Desktop.
a standalone class for doing byte copying...
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
| public class IOUtils | |
| public ByteArrayOutputStream readBytes(InputStream is) throws IOException{ | |
| ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |
| int nRead; | |
| byte[] data = new byte[1024 * 16]; | |
| while ((nRead = is.read(data, 0, data.length)) != -1) { | |
| baos.write(data, 0, nRead); | |
| } | |
| baos.flush(); | |
| return baos; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment