public static byte[] toBytes(final InputStream input) throws IOException {
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            int n = 0;
            byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];

            while (EOF != (n = input.read(buffer))) {
                output.write(buffer, 0, n);
            }
            return output.toByteArray();
        }
InputStream to byte[].

@param input input
@return byte
@throws IOException IOException
shenyu-admin/src/main/java/org/apache/shenyu/admin/utils/HttpUtils.java