1 28 29 package com.caucho.vfs.i18n; 30 31 import java.io.IOException ; 32 import java.io.InputStream ; 33 import java.io.InputStreamReader ; 34 import java.io.Reader ; 35 import java.io.UnsupportedEncodingException ; 36 import java.nio.charset.Charset ; 37 38 41 public class JDKReader extends EncodingReader { 42 45 public JDKReader() 46 { 47 } 48 49 57 public Reader create(InputStream is, String javaEncoding) 58 throws UnsupportedEncodingException 59 { 60 if (Charset.isSupported(javaEncoding)) { 61 Charset charset = Charset.forName(javaEncoding); 62 63 return new InputStreamReader (is, charset); 64 } 65 else { 66 return new InputStreamReader (is, javaEncoding); 68 } 69 } 70 71 74 public int read() 75 throws IOException 76 { 77 throw new UnsupportedOperationException (); 78 } 79 } 80 | Popular Tags |