Skip to content

Instantly share code, notes, and snippets.

View pavel-drabushevich's full-sized avatar

Pavel Drabushevich pavel-drabushevich

View GitHub Profile
private String streamToString(InputStream is) throws IOException
{
final char[] buffer = new char[0x10000];
final StringBuilder out = new StringBuilder();
InputStreamReader in = null;
try {
in = new InputStreamReader(is);
int read;
while((read = in.read(buffer)) > 0) {
out.append(buffer, 0, read);