>>481
boolean isSJISLeadingByte(byte b){
 int c = b & 0xFF;
 return (0x81 <= c && c <= 0x9F) || (0xE0 <= c && c <= 0xFC);
}
boolean isSJISTrailingByte(byte b){
 int c = b & 0xFF;
 return 0x40 <= c && c <= 0xFC && c != 0x7F;
}
boolean isMultiByte(byte b1, byte b2){
 return isSJISLeadingByte(b1) && isSJISTrailingByte(b2);
}