code: public static byte[] getBytes(InputStream in) throws IOException {
          ByteArrayOutputStream out = new ByteArrayOutputStream();
          pipeStream(in, out, 4096);
          return out.toByteArray();
      }
docs: Gets a byte array for the given input stream.