16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.nio.cs.ext; 27 28 import java.nio.ByteBuffer; 29 import java.nio.CharBuffer; 30 import java.nio.charset.Charset; 31 import java.nio.charset.CharsetDecoder; 32 import java.nio.charset.CharsetEncoder; 33 import java.nio.charset.CoderResult; 34 import java.nio.charset.CharacterCodingException; 35 import java.nio.charset.MalformedInputException; 36 import sun.nio.cs.HistoricallyNamedCharset; 37 import java.security.AccessController; 38 import java.security.PrivilegedAction; 39 import static java.lang.Character.UnicodeBlock; 40 41 42 public class JISAutoDetect 43 extends Charset 44 implements HistoricallyNamedCharset 45 { 46 47 private final static int EUCJP_MASK = 0x01; 48 private final static int SJIS2B_MASK = 0x02; 49 private final static int SJIS1B_MASK = 0x04; 50 private final static int EUCJP_KANA1_MASK = 0x08; 51 private final static int EUCJP_KANA2_MASK = 0x10; 52 53 public JISAutoDetect() { 54 super("x-JISAutoDetect", ExtendedCharsets.aliasesFor("x-JISAutoDetect")); 55 } 56 57 public boolean contains(Charset cs) { 58 return ((cs.name().equals("US-ASCII")) | 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package sun.nio.cs.ext; 27 28 import java.nio.ByteBuffer; 29 import java.nio.CharBuffer; 30 import java.nio.charset.Charset; 31 import java.nio.charset.CharsetDecoder; 32 import java.nio.charset.CharsetEncoder; 33 import java.nio.charset.CoderResult; 34 import java.nio.charset.CharacterCodingException; 35 import java.nio.charset.MalformedInputException; 36 import sun.nio.cs.DelegatableDecoder; 37 import sun.nio.cs.HistoricallyNamedCharset; 38 import java.security.AccessController; 39 import java.security.PrivilegedAction; 40 import sun.nio.cs.*; 41 import static java.lang.Character.UnicodeBlock; 42 43 44 public class JISAutoDetect 45 extends Charset 46 implements HistoricallyNamedCharset 47 { 48 49 private final static int EUCJP_MASK = 0x01; 50 private final static int SJIS2B_MASK = 0x02; 51 private final static int SJIS1B_MASK = 0x04; 52 private final static int EUCJP_KANA1_MASK = 0x08; 53 private final static int EUCJP_KANA2_MASK = 0x10; 54 55 public JISAutoDetect() { 56 super("x-JISAutoDetect", ExtendedCharsets.aliasesFor("x-JISAutoDetect")); 57 } 58 59 public boolean contains(Charset cs) { 60 return ((cs.name().equals("US-ASCII")) |