1 28 29 package com.caucho.vfs.i18n; 30 31 import com.caucho.vfs.OutputStreamWithBuffer; 32 33 import java.io.IOException ; 34 import java.util.logging.Logger ; 35 36 45 abstract public class EncodingWriter { 46 protected static final Logger log 47 = Logger.getLogger(EncodingWriter.class.getName()); 48 49 52 public String getJavaEncoding() 53 { 54 return "unknown"; 55 } 56 57 60 public void setJavaEncoding(String encoding) 61 { 62 } 63 64 71 public abstract EncodingWriter create(String javaEncoding); 72 73 78 public EncodingWriter create() 79 { 80 return create(getJavaEncoding()); 81 } 82 83 88 public abstract void write(OutputStreamWithBuffer os, char ch) 89 throws IOException ; 90 91 98 public void write(OutputStreamWithBuffer os, char []cbuf, int off, int len) 99 throws IOException 100 { 101 for (int i = 0; i < len; i++) 102 write(os, cbuf[off + i]); 103 } 104 } 105 | Popular Tags |