This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 24th, 2012  |  syntax: Java  |  size: 0.24 KB  |  views: 26  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. final MAX_BUFFER_SIZE = 256;
  2.  
  3. StringBuilder result = new StringBuilder();
  4. char[] buffer = new char[MAX_BUFFER_SIZE];
  5. int readChars;
  6. while ((readChars = stream.read(buffer, 0, MAX_BUFFER_SIZE)) > 0) {
  7.     result.append(buffer, 0, readChars);
  8. }
clone this paste RAW Paste Data