Methods Summary |
---|
static void | genCodes()
CodesGenerator gen = new CodesGenerator1();
int code = 0;
while (code < (1 << 10)) {
while (!gen.isAccepted(code)) code ++;
gen.consume(code);
code += 3;
}
while (code < (1 << 15)) {
while (!gen.isAccepted(code)) code ++;
gen.consume(code);
code += 33;
}
|
static void | genDecoded(java.nio.charset.Charset charset, java.nio.ByteBuffer bb)
CharsetDecoder decoder = charset.newDecoder();
// System.out.println(code);
// bytes[0] = (byte) code;
// System.out.println(bytes[0]);
// ByteBuffer inputBB = ByteBuffer.wrap(bytes);
// CharBuffer outputCB;
// try {
// outputCB = decoder.decode(inputBB);
// outputCB.rewind();
// System.out.println(outputCB);
// } catch (CharacterCodingException e) {
// System.out.println(e);
//// e.printStackTrace();
// }
|
static void | genEncoded(java.nio.charset.Charset charset, java.nio.CharBuffer cb)
System.out.println(charset.name());
Dumper out = new Dumper1();
CharsetEncoder encoder = charset.newEncoder();
encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
try {
ByteBuffer bb = encoder.encode(cb);
// bb.rewind();
while (bb.hasRemaining()) {
out.consume(bb.get());
}
} catch (CharacterCodingException e) {
System.out.println(e);
// e.printStackTrace();
}
|
public static void | main(java.lang.String[] args)
// charset = Charset.defaultCharset();
// decoder = charset.newDecoder();
// System.out.println(charset.name());
genEncoded(Charset.forName("MacRoman"), CharBuffer.wrap(chars));
// genEncoded(Charset.forName(charsetNames[37]), CharBuffer.wrap(chars));
|