Reads all bytes from an input stream into a byte array. Does not close the stream. <p><b>Java 9+ users:</b> use {@code in#readAllBytes()} instead. @param in the input stream to read from @return a byte array containing all the bytes from the stream @throws IOException if an I/O error occurs
(InputStream in)
| 238 | * @throws IOException if an I/O error occurs |
| 239 | */ |
| 240 | public static byte[] toByteArray(InputStream in) throws IOException { |
| 241 | checkNotNull(in); |
| 242 | return toByteArrayInternal(in, new ArrayDeque<byte[]>(TO_BYTE_ARRAY_DEQUE_SIZE), 0); |
| 243 | } |
| 244 | |
| 245 | /** |
| 246 | * Reads all bytes from an input stream into a byte array. The given expected size is used to |
no test coverage detected