MCPcopy Index your code
hub / github.com/apache/commons-io / toByteArray

Method toByteArray

src/main/java/org/apache/commons/io/IOUtils.java:719–723  ·  view source on GitHub ↗

Gets 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 NullPointerExceptio

(final InputStream input)

Source from the content-addressed store, hash-verified

717 * @throws IOException if an I/O error occurs
718 */
719 public static byte[] toByteArray(final InputStream input) throws IOException {
720 final ByteArrayOutputStream output = new ByteArrayOutputStream();
721 copy(input, output);
722 return output.toByteArray();
723 }
724
725 /**
726 * Gets contents of an <code>InputStream</code> as a <code>byte[]</code>.

Calls 7

copyMethod · 0.95
toByteArrayMethod · 0.95
toCharsetMethod · 0.95
closeMethod · 0.95
readMethod · 0.45
getBytesMethod · 0.45
getInputStreamMethod · 0.45