当前位置: 首页>>代码示例>>Java>>正文


Java StreamEncoder.forOutputStreamWriter方法代码示例

本文整理汇总了Java中sun.nio.cs.StreamEncoder.forOutputStreamWriter方法的典型用法代码示例。如果您正苦于以下问题:Java StreamEncoder.forOutputStreamWriter方法的具体用法?Java StreamEncoder.forOutputStreamWriter怎么用?Java StreamEncoder.forOutputStreamWriter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.nio.cs.StreamEncoder的用法示例。


在下文中一共展示了StreamEncoder.forOutputStreamWriter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Console

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
private Console() {
    readLock = new Object();
    writeLock = new Object();
    String csname = encoding();
    if (csname != null) {
        try {
            cs = Charset.forName(csname);
        } catch (Exception x) {}
    }
    if (cs == null)
        cs = Charset.defaultCharset();
    out = StreamEncoder.forOutputStreamWriter(
              new FileOutputStream(FileDescriptor.out),
              writeLock,
              cs);
    pw = new PrintWriter(out, true) { public void close() {} };
    formatter = new Formatter(out);
    reader = new LineReader(StreamDecoder.forInputStreamReader(
                 new FileInputStream(FileDescriptor.in),
                 readLock,
                 cs));
    rcb = new char[1024];
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:24,代码来源:Console.java

示例2: Console

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
private Console() {
       readLock = new Object();
       writeLock = new Object();    
       String csname = encoding();
       if (csname != null) {
           try {
               cs = Charset.forName(csname);
           } catch (Exception x) {}
       }
       if (cs == null)
           cs = Charset.defaultCharset();
       out = StreamEncoder.forOutputStreamWriter(
                 new FileOutputStream(FileDescriptor.out),
	  writeLock, 
	  cs);
       pw = new PrintWriter(out, true) { public void close() {} };
       formatter = new Formatter(out);
       reader = new LineReader(StreamDecoder.forInputStreamReader(
	     new FileInputStream(FileDescriptor.in),
	     readLock, 
	     cs));
rcb = new char[1024];
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:24,代码来源:Console.java

示例3: OutputStreamWriter

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
/**
 * Creates an OutputStreamWriter that uses the default character encoding.
 *
 * @param  out  An OutputStream
 */
public OutputStreamWriter(OutputStream out) {
    super(out);
    try {
        se = StreamEncoder.forOutputStreamWriter(out, this, (String)null);
    } catch (UnsupportedEncodingException e) {
        throw new Error(e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:OutputStreamWriter.java

示例4: OptimizedInterceptedOutputStreamWriter

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
OptimizedInterceptedOutputStreamWriter(OptimizedInterceptedFileOutputStream outputStream) {
       super(outputStream);
	this.outputStream = outputStream;

       try {
           this.encoder = StreamEncoder.forOutputStreamWriter(outputStream, this, (String)null);
       } catch (UnsupportedEncodingException e) {
           throw new Error(e);
       }
}
 
开发者ID:uwdb,项目名称:pipegen,代码行数:11,代码来源:OptimizedInterceptedOutputStreamWriter.java

示例5: OutputStreamWriter

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
/**
    * Creates an OutputStreamWriter that uses the default character encoding.
    *
    * @param  out  An OutputStream
    */
   public OutputStreamWriter(OutputStream out) {
super(out);
try {
    se = StreamEncoder.forOutputStreamWriter(out, this, (String)null);
} catch (UnsupportedEncodingException e) {
    throw new Error(e);
       }
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:14,代码来源:OutputStreamWriter.java

示例6: GZipResponseWriter

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
public GZipResponseWriter(OutputStream out, String charsetName)
    throws UnsupportedEncodingException {
    super(out);
    se = StreamEncoder.forOutputStreamWriter(out, this, charsetName);
}
 
开发者ID:otsecbsol,项目名称:linkbinder,代码行数:6,代码来源:GZipResponseWriter.java

示例7: OutputStreamWriter

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
/**
 * Creates an OutputStreamWriter that uses the named charset.
 *
 * @param  out
 *         An OutputStream
 *
 * @param  charsetName
 *         The name of a supported
 *         {@link java.nio.charset.Charset charset}
 *
 * @exception  UnsupportedEncodingException
 *             If the named encoding is not supported
 */
public OutputStreamWriter(OutputStream out, String charsetName)
    throws UnsupportedEncodingException
{
    super(out);
    if (charsetName == null)
        throw new NullPointerException("charsetName");
    se = StreamEncoder.forOutputStreamWriter(out, this, charsetName);
}
 
开发者ID:Java8-CNAPI-Team,项目名称:Java8CN,代码行数:22,代码来源:OutputStreamWriter.java

示例8: OutputStreamWriter

import sun.nio.cs.StreamEncoder; //导入方法依赖的package包/类
/**
 * Creates an OutputStreamWriter that uses the given charset encoder.
 *
 * @param  out
 *         An OutputStream
 *
 * @param  enc
 *         A charset encoder
 *
 * @since 1.4
 * @spec JSR-51
 */
public OutputStreamWriter(OutputStream out, CharsetEncoder enc) {
    super(out);
    if (enc == null)
        throw new NullPointerException("charset encoder");
    se = StreamEncoder.forOutputStreamWriter(out, this, enc);
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:19,代码来源:OutputStreamWriter.java


注:本文中的sun.nio.cs.StreamEncoder.forOutputStreamWriter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。