Can I change InputStream to Byte array?

Asked 2 years ago, Updated 2 years ago, 138 views

Can I change InputStream to Byte array?

java bytearray inputstream

2022-09-21 16:22

1 Answers

If you look at the static method of IOUtils, there is a method that returns inputStream to byte[]

InputStream is;
byte[] bytes = IOUtils.toByteArray(is);

You can use it like this


2022-09-21 16:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.