Java OutputStream Write writeStream(InputStream _from, Writer _printTo)

Here you can find the source of writeStream(InputStream _from, Writer _printTo)

Description

write Stream

License

Open Source License

Declaration

private static final void writeStream(InputStream _from, Writer _printTo) throws IOException 

Method Source Code


//package com.java2s;
import java.io.BufferedInputStream;

import java.io.BufferedReader;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import java.io.Reader;

import java.io.Writer;

public class Main {
    private static final void writeStream(InputStream _from, Writer _printTo) throws IOException {
        final Reader in = new BufferedReader(new InputStreamReader(new BufferedInputStream(_from)));
        while (in.ready())
            _printTo.write(in.read());//from   w w w.j  a v a2  s .c  o m
    }
}

Related

  1. serializeToOutputStream(final Serializable ser, final OutputStream os)
  2. serializeUUID(OutputStream out, UUID id)
  3. writeStream(byte[] data, OutputStream os)
  4. writeStream(byte[] data, OutputStream out)
  5. writeStream(final OutputStream out, final String content, final boolean close)
  6. writeStream(InputStream in, File file)
  7. writeStream(InputStream inputStream, OutputStream out)
  8. writeStream(OutputStream out, byte[] data)
  9. writeStream(OutputStream output, String dataStr)