public String toStringNoClose(InputStream is, int length) {
        byte bytes[] = new byte[length];
        try {
            int total = 0;
            for (int read; total < length && (read = is.read(bytes, total, length-total)) != -1; total += read);
            assert total == length;
            return new String(bytes);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }