@SuppressWarnings("resource") @Test public void copy_readerToWriter() throws Exception { InputStream in = new ByteArrayInputStream(inData); in = new YellOnCloseInputStream(in); final Reader reader = new java.io.InputStreamReader(in, "US-ASCII"); final ByteArrayOutputStream baout = new ByteArrayOutputStream(); final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true); final Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII"); final int count = CopyUtils.copy(reader, writer); writer.flush(); assertEquals( "The number of characters returned by copy is wrong", inData.length, count); assertEquals("Sizes differ", inData.length, baout.size()); assertTrue("Content differs", Arrays.equals(inData, baout.toByteArray())); }
public static void copy(final byte[] input, final OutputStream output) throws IOException { output.write(input); }
CopyUtils { public static void copy(final byte[] input, final OutputStream output) throws IOException { output.write(input); } }
CopyUtils { public static void copy(final byte[] input, final OutputStream output) throws IOException { output.write(input); } CopyUtils(); }
CopyUtils { public static void copy(final byte[] input, final OutputStream output) throws IOException { output.write(input); } CopyUtils(); static void copy(final byte[] input, final OutputStream output); @Deprecated static void copy(final byte[] input, final Writer output); static void copy(
            final byte[] input,
            final Writer output,
            final String encoding); static int copy(
            final InputStream input,
            final OutputStream output); static int copy(
            final Reader input,
            final Writer output); @Deprecated static void copy(
            final InputStream input,
            final Writer output); static void copy(
            final InputStream input,
            final Writer output,
            final String encoding); @Deprecated static void copy(
            final Reader input,
            final OutputStream output); static void copy(
            final Reader input,
            final OutputStream output,
            final String encoding); @Deprecated static void copy(
            final String input,
            final OutputStream output); static void copy(
            final String input,
            final OutputStream output,
            final String encoding); static void copy(final String input, final Writer output); }
CopyUtils { public static void copy(final byte[] input, final OutputStream output) throws IOException { output.write(input); } CopyUtils(); static void copy(final byte[] input, final OutputStream output); @Deprecated static void copy(final byte[] input, final Writer output); static void copy(
            final byte[] input,
            final Writer output,
            final String encoding); static int copy(
            final InputStream input,
            final OutputStream output); static int copy(
            final Reader input,
            final Writer output); @Deprecated static void copy(
            final InputStream input,
            final Writer output); static void copy(
            final InputStream input,
            final Writer output,
            final String encoding); @Deprecated static void copy(
            final Reader input,
            final OutputStream output); static void copy(
            final Reader input,
            final OutputStream output,
            final String encoding); @Deprecated static void copy(
            final String input,
            final OutputStream output); static void copy(
            final String input,
            final OutputStream output,
            final String encoding); static void copy(final String input, final Writer output);  }