aliocrlib/src/main/java/com/lib/aliocr/utils/io/IOUtils.java
/**
     * Get the contents of an <code>InputStream</code> as a <code>byte[]</code>.
     * <p/>
     * This method buffers the input internally, so there is no need to use a
     * <code>BufferedInputStream</code>.
     *
     * @param input the <code>InputStream</code> to read from
     * @return the requested byte array
     * @throws NullPointerException if the input is null
     * @throws IOException          if an I/O error occurs
     */
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 if the input is null
@throws IOException          if an I/O error occurs
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 if the input is null @throws IOException if an I / O error occurs
public static byte[] toByteArray(InputStream input) throws IOException {
        ByteArrayOutputStream output =
                new  ByteArrayOutputStream();
        copy(input, output);
        return output.toByteArray();
    }
public static byte [ ] toByteArray ( InputStream input ) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; copy ( input , output ) ; return output . toByteArray ( ) ; }
Get the contents of an <code>InputStream</code> as a <code>byte[]</code>.
Get the contents of an <code > InputStream< / code > as a <code > byte [] < / code > .