Created
July 13, 2012 13:33
-
-
Save anonymous/3104907 to your computer and use it in GitHub Desktop.
Java InputStream Code.
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
| bytesAvailable = fileInputStream.available(); | |
| bufferSize = Math.min(bytesAvailable, maxBufferSize); | |
| buffer = new byte[bufferSize]; | |
| // read file and write it into form... | |
| bytesRead = fileInputStream.read(buffer, 0, bufferSize); | |
| while (bytesRead > 0) { | |
| dos.write(buffer, 0, bufferSize); | |
| bytesAvailable = fileInputStream.available(); | |
| bufferSize = Math.min(bytesAvailable, maxBufferSize); | |
| bytesRead = fileInputStream.read(buffer, 0, bufferSize); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment