
Untitled
By: a guest on
Jun 22nd, 2012 | syntax:
Java | size: 0.48 KB | hits: 18 | expires: Never
ByteArrayOutputStream os = new ByteArrayOutputStream();
byte[] buffer = new byte[128];
int length = 0;
while(true)
{
length = stream.read(buffer, 0, 128);
os.write(buffer, 0, length);
if(length < 128)
break;
}
return new String(os.toByteArray());