StreamUtil { public static void transfer( InputStream inputStream, OutputStream outputStream) throws IOException { transfer(inputStream, outputStream, BUFFER_SIZE, true); }  static void cleanUp(Closeable... closeables); static byte[] toByteArray(InputStream inputStream); static String toString(InputStream inputStream); static String toString(InputStream inputStream, String charsetName); static void transfer(
			InputStream inputStream, OutputStream outputStream); static void transfer(
			InputStream inputStream, OutputStream outputStream, boolean cleanUp); static void transfer(
			InputStream inputStream, OutputStream outputStream, int bufferSize); static void transfer(
			InputStream inputStream, OutputStream outputStream, int bufferSize,
			boolean cleanUp); static void transfer(
			InputStream inputStream, OutputStream outputStream, int bufferSize,
			boolean cleanUp, long length); static void transfer(
			InputStream inputStream, OutputStream outputStream, long length); static final int BUFFER_SIZE; static final boolean FORCE_TIO; }
@Test public void testTransferNPEs() throws IOException { try { StreamUtil.transfer(null, null); Assert.fail(); } catch (NullPointerException nullPointerException) { Assert.assertEquals( "Input stream is null", nullPointerException.getMessage()); } try { StreamUtil.transfer( new UnsyncByteArrayInputStream(new byte[0]), null); Assert.fail(); } catch (NullPointerException nullPointerException) { Assert.assertEquals( "Output stream is null", nullPointerException.getMessage()); } }