📄 stringcoder.java
字号:
package com.croftsoft.core.io; import java.io.*; import com.croftsoft.core.lang.NullArgumentException; /********************************************************************* * A String Encoder and Parser. * * @version * 2003-06-02 * @since * 2003-06-01 * @author * <a href="http://www.croftsoft.com/">David Wallace Croft</a> *********************************************************************/ public final class StringCoder implements Encoder, Parser ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// { public static final String US_ASCII = "US-ASCII"; public static final String UTF_8 = "UTF-8"; // private final String charSetName; ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// public StringCoder ( String charSetName ) ////////////////////////////////////////////////////////////////////// { NullArgumentException.check ( this.charSetName = charSetName ); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// public byte [ ] encode ( Object object ) throws IOException ////////////////////////////////////////////////////////////////////// { return object.toString ( ).getBytes ( charSetName ); } public Object parse ( InputStream inputStream, int contentLength ) throws IOException ////////////////////////////////////////////////////////////////////// { return StreamLib.toString ( inputStream, charSetName ); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -