All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dingtalk.open.app.api.util.IoUtils Maven / Gradle / Ivy

There is a newer version: 1.3.7
Show newest version
package com.dingtalk.open.app.api.util;

import java.io.InputStream;

/**
 * @author feiyin
 * @date 2023/3/1
 */
public class IoUtils {
    public static byte[] readAll(InputStream stream) throws Exception {
        if (stream == null) {
            return null;
        }
        int count = stream.available();
        byte[] content = new byte[count];
        while (count > 0) {
            int readBytes = stream.read(content);
            count -= readBytes;
        }
        return content;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy