📜  如何在java代码示例中将输出流转换为字节数组输出流

📅  最后修改于: 2022-03-11 14:52:17.590000             🧑  作者: Mango

代码示例1
ByteArrayOutputStream bos = new ByteArrayOutputStream();
    
//Write the data to the byte array output stream here
    
byte[] arr = bos.toByteArray();
//write the byte stream to the output stream
os.write(arr);