Java OutputStream Write writeStreamCharwiseLimited(final Reader in, final Writer out, final int len)

Here you can find the source of writeStreamCharwiseLimited(final Reader in, final Writer out, final int len)

Description

write Stream Charwise Limited

License

Open Source License

Declaration

public static int writeStreamCharwiseLimited(final Reader in, final Writer out, final int len)
            throws IOException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.io.Reader;
import java.io.Writer;

public class Main {
    public static int writeStreamCharwiseLimited(final Reader in, final Writer out, final int len)
            throws IOException {
        int read;
        int count = 0;

        while (true) {
            read = in.read();/*from w  ww .j a v a 2  s. co  m*/
            if (read == -1) {
                return count;
            }

            out.write(read);
            count++;
        }
    }
}

Related

  1. writeStream(OutputStream output, String dataStr)
  2. writeStream(OutputStream outputStream, InputStream inputStream, byte[] buffer)
  3. writeStream(String content, String charset, OutputStream outputStream)
  4. writeStreamBuffered(final Reader in, final Writer out)
  5. writeStreamCharwise(final Reader in, final Writer out)
  6. writeStreamFromString(String contents, OutputStream outputStream)
  7. writeStreamFromString(String serializePath)
  8. writeStreamInFile(File f, InputStream in)
  9. writeStreamText(OutputStream out, String text)