Package org.gjt.sp.jedit.io
Class EncodingServer
- java.lang.Object
-
- org.gjt.sp.jedit.io.EncodingServer
-
public class EncodingServer extends java.lang.ObjectA class for some static methods to deal with encodings.- Since:
- 4.3pre10
-
-
Constructor Summary
Constructors Constructor Description EncodingServer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<java.lang.String>getAvailableNames()Returns the set of all available encoding names.static EncodinggetEncoding(java.lang.String name)Returns an instance of Encoding for specified name.static java.util.Set<java.lang.String>getSelectedNames()Returns the set of user selected encoding names.static java.io.ReadergetTextReader(java.io.InputStream in, java.lang.String encoding)Returns a Reader object that reads the InputStream with the encoding.static java.io.WritergetTextWriter(java.io.OutputStream out, java.lang.String encoding)Returns a Writer object that writes to the OutputStream with the encoding.static booleanhasEncoding(java.lang.String name)Returns if the specified name is supported as a name for an Encoding.
-
-
-
Method Detail
-
getEncoding
public static Encoding getEncoding(java.lang.String name)
Returns an instance of Encoding for specified name. The name is used for search the following domains in the listed order. - java.nio.charset.Charset - jEdit ServiceManager
-
getAvailableNames
public static java.util.Set<java.lang.String> getAvailableNames()
Returns the set of all available encoding names.
-
getSelectedNames
public static java.util.Set<java.lang.String> getSelectedNames()
Returns the set of user selected encoding names.
-
getTextReader
public static java.io.Reader getTextReader(java.io.InputStream in, java.lang.String encoding) throws java.io.IOExceptionReturns a Reader object that reads the InputStream with the encoding. This method is same with "getEncoding(encoding).getTextReader(in)".- Throws:
java.io.IOException
-
getTextWriter
public static java.io.Writer getTextWriter(java.io.OutputStream out, java.lang.String encoding) throws java.io.IOExceptionReturns a Writer object that writes to the OutputStream with the encoding. This method is same with "getEncoding(encoding).getTextWriter(out)".- Throws:
java.io.IOException
-
hasEncoding
public static boolean hasEncoding(java.lang.String name)
Returns if the specified name is supported as a name for an Encoding.
-
-