Get the contents of an InputStream as a byte[] . This method buffers the input internally, so there is no need to use a BufferedInputStream . @param input the InputStream to read from @return the requested byte array @throws NullPointerException
(InputStream input)
| 550 | * @throws IOException if an I/O error occurs |
| 551 | */ |
| 552 | public static byte[] toByteArray(InputStream input) throws IOException { |
| 553 | ByteArrayOutputStream output = new ByteArrayOutputStream(); |
| 554 | copy(input, output); |
| 555 | return output.toByteArray(); |
| 556 | } |
| 557 | |
| 558 | /** |
| 559 | * Get the contents of a <code>Reader</code> as a <code>byte[]</code> using the |
no test coverage detected