java inputStream用一次后报错了

java inputStream用一次后报错了,我想使用同一个inputStream


private static  byte[] cloneInputStream(InputStream input) {
    try {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        byte[] buffer = new byte[1024];
        int len;
        while ((len = input.read(buffer)) > -1) {
            baos.write(buffer, 0, len);
        }
        baos.flush();
        baos.close()
        input.close()
        return baos.toByteArray();
    } catch (IOException e) {
        e.printStackTrace();
        return null;
    }
}
 
byte[] bytes = cloneInputStream(inputStream); 
InputStream inputStream1 = new ByteArrayInputStream(bytes);
InputStream inputStream2 = new ByteArrayInputStream(bytes);