Created
June 10, 2013 07:12
-
-
Save kibao/5747029 to your computer and use it in GitHub Desktop.
InputStream to String
This file contains 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
InputStream response; | |
ByteArrayOutputStream buf = new ByteArrayOutputStream(); | |
int result = response.read(); | |
while(result != -1) { | |
byte b = (byte)result; | |
buf.write(b); | |
result = response.read(); | |
} | |
System.out.println(buf.toString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment