1 21 package org.apache.derby.iapi.tools.i18n; 22 23 import java.io.PrintWriter ; 24 import java.io.OutputStreamWriter ; 25 import java.io.OutputStream ; 26 import java.io.UnsupportedEncodingException ; 27 28 public class LocalizedOutput extends PrintWriter { 29 private OutputStream out; 30 public LocalizedOutput(OutputStream o){ 31 super(new OutputStreamWriter (o), true); 32 out = o; 33 } 34 LocalizedOutput(OutputStream o, String enc) throws UnsupportedEncodingException { 35 super(new OutputStreamWriter (o, enc), true); 36 out = o; 37 } 38 public boolean isStandardOutput(){ 39 return (out == System.out); 40 } 41 public void close() { 42 if (!isStandardOutput()) { 43 super.close(); 44 } 45 } 46 } 47 | Popular Tags |