List of usage examples for com.liferay.portal.kernel.util StreamUtil transfer
public static void transfer(InputStream inputStream, OutputStream outputStream, int bufferSize, boolean cleanUp) throws IOException
From source file:com.liferay.petra.log4j.Log4JUtil.java
License:Open Source License
/** * @see com.liferay.portal.util.FileImpl#getBytes(InputStream, int, boolean) *//* w ww. j ava 2 s .c om*/ private static byte[] _getBytes(InputStream inputStream) throws IOException { UnsyncByteArrayOutputStream unsyncByteArrayOutputStream = new UnsyncByteArrayOutputStream(); StreamUtil.transfer(inputStream, unsyncByteArrayOutputStream, -1, true); return unsyncByteArrayOutputStream.toByteArray(); }