< prev index next >

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

Print this page




 118             return c2bSupp[end + i];
 119         return UNMAPPABLE_ENCODING;
 120     }
 121 
 122     public boolean isCompositeBase(Entry comp) {
 123         if (comp.cp <= 0x31f7 && comp.cp >= 0xe6) {
 124             return (findCP(c2bComp, comp) >= 0);
 125         }
 126         return false;
 127     }
 128 
 129     public int encodeComposite(Entry comp) {
 130         int i = findComp(c2bComp, comp);
 131         if (i >= 0)
 132             return c2bComp[i].bs;
 133         return UNMAPPABLE_ENCODING;
 134     }
 135 
 136     // init the CharsetMapping object from the .dat binary file
 137     public static CharsetMapping get(final InputStream is) {
 138         return AccessController.doPrivileged(new PrivilegedAction<CharsetMapping>() {
 139             public CharsetMapping run() {
 140                 return new CharsetMapping().load(is);
 141             }
 142         });
 143     }
 144 
 145     public static class Entry {
 146         public int bs;   //byte sequence reps
 147         public int cp;   //Unicode codepoint
 148         public int cp2;  //CC of composite
 149     }
 150 
 151     static Comparator<Entry> comparatorBytes =
 152         new Comparator<Entry>() {
 153             public int compare(Entry m1, Entry m2) {
 154                 return m1.bs - m2.bs;
 155             }
 156             public boolean equals(Object obj) {
 157                 return this == obj;
 158             }




 118             return c2bSupp[end + i];
 119         return UNMAPPABLE_ENCODING;
 120     }
 121 
 122     public boolean isCompositeBase(Entry comp) {
 123         if (comp.cp <= 0x31f7 && comp.cp >= 0xe6) {
 124             return (findCP(c2bComp, comp) >= 0);
 125         }
 126         return false;
 127     }
 128 
 129     public int encodeComposite(Entry comp) {
 130         int i = findComp(c2bComp, comp);
 131         if (i >= 0)
 132             return c2bComp[i].bs;
 133         return UNMAPPABLE_ENCODING;
 134     }
 135 
 136     // init the CharsetMapping object from the .dat binary file
 137     public static CharsetMapping get(final InputStream is) {
 138         return AccessController.doPrivileged(new PrivilegedAction<>() {
 139             public CharsetMapping run() {
 140                 return new CharsetMapping().load(is);
 141             }
 142         });
 143     }
 144 
 145     public static class Entry {
 146         public int bs;   //byte sequence reps
 147         public int cp;   //Unicode codepoint
 148         public int cp2;  //CC of composite
 149     }
 150 
 151     static Comparator<Entry> comparatorBytes =
 152         new Comparator<Entry>() {
 153             public int compare(Entry m1, Entry m2) {
 154                 return m1.bs - m2.bs;
 155             }
 156             public boolean equals(Object obj) {
 157                 return this == obj;
 158             }


< prev index next >