Java Text File Write by Charset newWriter(WritableByteChannel ch, Charset cs)

Here you can find the source of newWriter(WritableByteChannel ch, Charset cs)

Description

new Writer

License

Open Source License

Declaration

public static Writer newWriter(WritableByteChannel ch, Charset cs) 

Method Source Code

//package com.java2s;

import java.io.Writer;

import java.nio.channels.Channels;

import java.nio.channels.WritableByteChannel;
import java.nio.charset.Charset;

public class Main {
    public static Writer newWriter(WritableByteChannel ch, Charset cs) {
        if (ch == null)
            return null;
        return Channels.newWriter(ch, cs.newEncoder(), -1);
    }/*www .j av a2 s. co m*/
}

Related

  1. getWriter(String fileName, Charset cs)
  2. getWriter(String path, Charset encoding)
  3. newFilePrintWriter(File file, Charset charset)
  4. newWriter(File file, Charset charset)
  5. newWriter(OutputStream output, Charset encoding)
  6. openTextFileForWriting(File f, Charset encoding)
  7. openWriter(OutputStream stream, Charset charset, boolean autoflush)
  8. write(char[] data, File file, String charsetName)
  9. write(File file, Charset charset, String content)