@Test public void testCloseArguments() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream() { public void close() throws IOException { throw new AssertionError(); } }; ByteArrayInputStream bais = new ByteArrayInputStream(new byte[] {1, 2, 3, 4, 5}); ObjectConverterUtil.write(baos, bais, new byte[3], 4, false, true); assertEquals(4, baos.toByteArray().length); }
public static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length) throws IOException { return write(out, is, l_buffer, length, true, true); }
ObjectConverterUtil { public static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length) throws IOException { return write(out, is, l_buffer, length, true, true); } }
ObjectConverterUtil { public static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length) throws IOException { return write(out, is, l_buffer, length, true, true); }  }
ObjectConverterUtil { public static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length) throws IOException { return write(out, is, l_buffer, length, true, true); }  static byte[] convertToByteArray(final Object data); static byte[] convertToByteArray(final InputStream is); static byte[] convertToByteArray(final InputStream is, int length); static byte[] convertToByteArray(final InputStream is, int length, boolean close); static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length); static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length, boolean closeBoth); static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length, boolean closeOutput, boolean closeInput); static int write(final OutputStream out, final InputStream is, int length); static int write(final OutputStream out, final InputStream is, int length, boolean close); static int write(final OutputStream out, final InputStream is, int length, boolean closeOutput, boolean closeInput); static int write(final Writer out, final Reader is, int length, boolean close); static InputStream convertToInputStream(byte[] data); static void write(final InputStream is, final String fileName); static void write(final InputStream is, final File f); static void write(byte[] data, final String fileName); static char[] bytesToChar(byte[] bytes, String encoding); static byte[] convertFileToByteArray(File file); static String convertFileToString(final File file); static String convertToString(final InputStream stream); static char[] convertToCharArray(InputStream stream, int length, String encoding); static byte[] convertToByteArray(ZipEntry ze, ZipFile zip); static String convertToString(Reader reader); static String convertToString(Reader reader, int length); }
ObjectConverterUtil { public static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length) throws IOException { return write(out, is, l_buffer, length, true, true); }  static byte[] convertToByteArray(final Object data); static byte[] convertToByteArray(final InputStream is); static byte[] convertToByteArray(final InputStream is, int length); static byte[] convertToByteArray(final InputStream is, int length, boolean close); static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length); static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length, boolean closeBoth); static int write(final OutputStream out, final InputStream is, byte[] l_buffer, int length, boolean closeOutput, boolean closeInput); static int write(final OutputStream out, final InputStream is, int length); static int write(final OutputStream out, final InputStream is, int length, boolean close); static int write(final OutputStream out, final InputStream is, int length, boolean closeOutput, boolean closeInput); static int write(final Writer out, final Reader is, int length, boolean close); static InputStream convertToInputStream(byte[] data); static void write(final InputStream is, final String fileName); static void write(final InputStream is, final File f); static void write(byte[] data, final String fileName); static char[] bytesToChar(byte[] bytes, String encoding); static byte[] convertFileToByteArray(File file); static String convertFileToString(final File file); static String convertToString(final InputStream stream); static char[] convertToCharArray(InputStream stream, int length, String encoding); static byte[] convertToByteArray(ZipEntry ze, ZipFile zip); static String convertToString(Reader reader); static String convertToString(Reader reader, int length);  }