List of utility methods to do InputStream to ByteBuffer Read
boolean | readIntoBuffer(InputStream is, ByteBuffer buf) read Into Buffer while (!isFull(buf)) { int bytes_read = is.read(buf.array(), buf.position(), bytesRemaining(buf)); if (bytes_read == -1) return true; increasePosition(buf, bytes_read); return false; ... |
String | Slurp(final InputStream is, final int bufferSize) slurp final char[] buffer = new char[bufferSize]; final StringBuilder out = new StringBuilder(); try { final Reader in = new InputStreamReader(is, "UTF-8"); try { for (;;) { int rsz = in.read(buffer, 0, buffer.length); if (rsz < 0) ... |