< prev index next >

src/java.base/share/classes/sun/nio/cs/CESU_8.java

Print this page
rev 17642 : 8186517: sun.nio.cs.StandardCharsets$Aliases and Classes can be lazily loaded
Reviewed-by: sherman, martin, plevart


  35 import java.nio.charset.CodingErrorAction;
  36 
  37 /* Legal CESU-8 Byte Sequences
  38  *
  39  * #    Code Points      Bits   Bit/Byte pattern
  40  * 1                     7      0xxxxxxx
  41  *      U+0000..U+007F          00..7F
  42  *
  43  * 2                     11     110xxxxx    10xxxxxx
  44  *      U+0080..U+07FF          C2..DF      80..BF
  45  *
  46  * 3                     16     1110xxxx    10xxxxxx    10xxxxxx
  47  *      U+0800..U+0FFF          E0          A0..BF      80..BF
  48  *      U+1000..U+FFFF          E1..EF      80..BF      80..BF
  49  *
  50  */
  51 
  52 class CESU_8 extends Unicode
  53 {
  54     public CESU_8() {
  55         super("CESU-8", StandardCharsets.aliases_CESU_8);
  56     }
  57 
  58     public String historicalName() {
  59         return "CESU8";
  60     }
  61 
  62     public CharsetDecoder newDecoder() {
  63         return new Decoder(this);
  64     }
  65 
  66     public CharsetEncoder newEncoder() {
  67         return new Encoder(this);
  68     }
  69 
  70     private static final void updatePositions(Buffer src, int sp,
  71                                               Buffer dst, int dp) {
  72         src.position(sp - src.arrayOffset());
  73         dst.position(dp - dst.arrayOffset());
  74     }
  75 




  35 import java.nio.charset.CodingErrorAction;
  36 
  37 /* Legal CESU-8 Byte Sequences
  38  *
  39  * #    Code Points      Bits   Bit/Byte pattern
  40  * 1                     7      0xxxxxxx
  41  *      U+0000..U+007F          00..7F
  42  *
  43  * 2                     11     110xxxxx    10xxxxxx
  44  *      U+0080..U+07FF          C2..DF      80..BF
  45  *
  46  * 3                     16     1110xxxx    10xxxxxx    10xxxxxx
  47  *      U+0800..U+0FFF          E0          A0..BF      80..BF
  48  *      U+1000..U+FFFF          E1..EF      80..BF      80..BF
  49  *
  50  */
  51 
  52 class CESU_8 extends Unicode
  53 {
  54     public CESU_8() {
  55         super("CESU-8", StandardCharsets.aliases_CESU_8());
  56     }
  57 
  58     public String historicalName() {
  59         return "CESU8";
  60     }
  61 
  62     public CharsetDecoder newDecoder() {
  63         return new Decoder(this);
  64     }
  65 
  66     public CharsetEncoder newEncoder() {
  67         return new Encoder(this);
  68     }
  69 
  70     private static final void updatePositions(Buffer src, int sp,
  71                                               Buffer dst, int dp) {
  72         src.position(sp - src.arrayOffset());
  73         dst.position(dp - dst.arrayOffset());
  74     }
  75 


< prev index next >