/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/ |
D | CharsetTest.java | 22 import java.nio.charset.Charset; 47 for (String charsetName : Charset.availableCharsets().keySet()) { in test_allAvailableCharsets() 48 Charset cs = Charset.forName(charsetName); in test_allAvailableCharsets() 59 assertEquals("UTF-8", Charset.defaultCharset().name()); in test_defaultCharset() 71 Set<String> names = Charset.availableCharsets().keySet(); in test_isRegistered() 83 Charset cs = Charset.forName(name); in test_isRegistered() 91 Charset cs = Charset.forName(name); in test_isRegistered() 98 assertNotNull(Charset.forName("ISO-8859-1")); in test_guaranteedCharsetsAvailable() 99 assertNotNull(Charset.forName("US-ASCII")); in test_guaranteedCharsetsAvailable() 100 assertNotNull(Charset.forName("UTF-16")); in test_guaranteedCharsetsAvailable() [all …]
|
D | CharsetEncoder2Test.java | 23 import java.nio.charset.Charset; 40 Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$ in test_ConstructorLjava_nio_charset_CharsetFF() 48 Charset cs = Charset.forName("ISO8859-1"); //$NON-NLS-1$ in test_ConstructorLjava_nio_charset_CharsetFF() 73 protected MockCharsetEncoderForHarmony141(Charset cs, in MockCharsetEncoderForHarmony141() 78 public MockCharsetEncoderForHarmony141(Charset cs, in MockCharsetEncoderForHarmony141() 91 public MockCharsetEncoderForHarmony491(Charset arg0, float arg1, in MockCharsetEncoderForHarmony491() 121 static final class MockMalfunctionCharset extends Charset { 127 public boolean contains(Charset cs) { in contains() 132 return Charset.forName("UTF-8").newDecoder(); in newDecoder() 145 public MockMalfunctionEncoder(Charset cs) { in MockMalfunctionEncoder() [all …]
|
D | CharsetDecoder2Test.java | 24 import java.nio.charset.Charset; 44 Charset cs = Charset.forName("UTF-8"); //$NON-NLS-1$ in test_ConstructorLjava_nio_charset_CharsetFF() 56 protected MockCharsetDecoderForHarmony142(Charset cs, in MockCharsetDecoderForHarmony142() 91 CharsetDecoder decoder2 = Charset.forName("UTF-16").newDecoder(); in test_decode() 131 static final class MockMalfunctionCharset extends Charset { 137 public boolean contains(Charset cs) { in contains() 155 public MockMalfunctionDecoder(Charset cs) { in MockMalfunctionDecoder() 169 public MockMalfunctionEncoder(Charset cs) { in MockMalfunctionEncoder() 184 Charset cs = Charset.forName("UTF-8"); in testDecodeLjava_nio_ByteBuffer_ReplaceOverflow() 211 public MockMalformedDecoder(Charset cs) { in MockMalformedDecoder() [all …]
|
D | AbstractCharsetTestCase.java | 22 import java.nio.charset.Charset; 44 protected Charset testingCharset; 53 this.testingCharset = Charset.forName(this.canonicalName); in setUp() 105 Charset c = Charset.forName(this.aliases[i]); in testAliases()
|
D | GBCharsetEncoderTest.java | 21 import java.nio.charset.Charset; 29 private static final Charset CS = Charset.forName("gb18030");
|
D | UTFCharsetEncoderTest.java | 21 import java.nio.charset.Charset; 29 private static final Charset CS = Charset.forName("utf-8");
|
D | UTF16LECharsetEncoderTest.java | 21 import java.nio.charset.Charset; 29 private static final Charset CS = Charset.forName("utf-16le");
|
D | UTF16BECharsetEncoderTest.java | 21 import java.nio.charset.Charset; 29 private static final Charset CS = Charset.forName("utf-16be");
|
/libcore/ojluni/src/main/java/java/nio/charset/ |
D | StandardCharsets.java | 44 public static final Charset US_ASCII = Charset.forName("US-ASCII"); 48 public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1"); 52 public static final Charset UTF_8 = Charset.forName("UTF-8"); 56 public static final Charset UTF_16BE = Charset.forName("UTF-16BE"); 60 public static final Charset UTF_16LE = Charset.forName("UTF-16LE"); 65 public static final Charset UTF_16 = Charset.forName("UTF-16");
|
D | Charset.java | 273 public abstract class Charset class 274 implements Comparable<Charset> 330 private static volatile Map.Entry<String, Charset> cache1 = null; // "Level 1" cache 331 private static final HashMap<String, Charset> cache2 = new HashMap<>(); // "Level 2" cache 333 private static void cache(String charsetName, Charset cs) { in cache() 336 Charset canonicalCharset = cache2.get(canonicalName); in cache() 407 private static Charset lookupViaProviders(final String charsetName) { in lookupViaProviders() 427 new PrivilegedAction<Charset>() { in lookupViaProviders() 428 public Charset run() { in lookupViaProviders() 432 Charset cs = cp.charsetForName(charsetName); in lookupViaProviders() [all …]
|
/libcore/ojluni/annotations/hiddenapi/java/nio/charset/ |
D | Charset.java | 32 public abstract class Charset implements java.lang.Comparable<java.nio.charset.Charset> { class 34 protected Charset(java.lang.String canonicalName, java.lang.String[] aliases) { in Charset() method in Charset 46 private static void cache(java.lang.String charsetName, java.nio.charset.Charset cs) { in cache() 54 private static java.nio.charset.Charset lookupViaProviders(java.lang.String charsetName) { in lookupViaProviders() 58 private static java.nio.charset.Charset lookup(java.lang.String charsetName) { in lookup() 62 private static java.nio.charset.Charset lookup2(java.lang.String charsetName) { in lookup2() 70 public static java.nio.charset.Charset forName(java.lang.String charsetName) { in forName() 74 public static java.nio.charset.Charset forNameUEE(java.lang.String charsetName) in forNameUEE() 80 java.util.Iterator<java.nio.charset.Charset> i, in put() 81 java.util.Map<java.lang.String, java.nio.charset.Charset> m) { in put() [all …]
|
D | CharsetEncoder.java | 37 java.nio.charset.Charset cs, in CharsetEncoder() 45 java.nio.charset.Charset cs, in CharsetEncoder() 54 java.nio.charset.Charset cs, float averageBytesPerChar, float maxBytesPerChar) { in CharsetEncoder() 58 public final java.nio.charset.Charset charset() { in charset() 174 private final java.nio.charset.Charset charset;
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | StringTest.java | 22 import java.nio.charset.Charset; 574 new String(new byte[8], 0, 4, Charset.defaultCharset()); in test_ConstructorBIIL() 575 new String(new byte[8], 8, 0, Charset.defaultCharset()); in test_ConstructorBIIL() 576 new String(new byte[0], 0, 0, Charset.defaultCharset()); in test_ConstructorBIIL() 579 new String(new byte[8], 0, 9, Charset.defaultCharset()); in test_ConstructorBIIL() 585 new String(new byte[8], 9, 0, Charset.defaultCharset()); in test_ConstructorBIIL() 591 new String(new byte[8], -1, 0, Charset.defaultCharset()); in test_ConstructorBIIL() 597 new String(new byte[8], 9, -1, Charset.defaultCharset()); in test_ConstructorBIIL() 603 new String(null, -1, 0, Charset.defaultCharset()); in test_ConstructorBIIL() 609 new String(null, 0, -1, Charset.defaultCharset()); in test_ConstructorBIIL() [all …]
|
/libcore/luni/src/test/java/libcore/java/nio/charset/ |
D | CharsetTest.java | 19 import java.nio.charset.Charset; 24 Charset cs = Charset.forName("UTF8"); in test_nonstandardCharsetName() 30 assertNotNull(Charset.forName("UTF8")); in test_nonstandardCharsetName() 44 Charset cs = Charset.forName(name); in run()
|
D | CharsetEncoderTest.java | 21 import java.nio.charset.Charset; 32 Charset ascii = Charset.forName("US-ASCII"); in test_replaceWith() 43 byte[] result = Charset.forName(charset).newEncoder().replacement(); in assertReplacementBytesForEncoder() 69 Charset cs = Charset.forName("UTF-32BE"); in testSurrogatePairAllAtOnce() 83 Charset cs = Charset.forName("UTF-32BE"); in testMalformedSurrogatePair() 118 Charset cs = Charset.forName("UTF-32BE"); in testCharsetEncoderSplitSurrogates() 144 Charset cs = Charset.forName("UTF-32BE"); in testFlushWithoutEndOfInput() 168 private static final class MockCharset extends Charset { 169 static final Charset INSTANCE = new MockCharset(); 175 public boolean contains(Charset charset) { in contains()
|
D | CharsetDecoderTest.java | 22 import java.nio.charset.Charset; 31 CharsetDecoder d = Charset.forName("UTF-16").newDecoder(); in test_replaceWith() 41 CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder(); in test_ByteArray_decode_no_offset() 55 CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder(); in test_ByteArray_decode_with_offset() 71 CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder(); in test_ByteArray_decode_with_offset_using_facade_method() 87 CharsetEncoder encoder = Charset.forName(charsetName).newEncoder(); in encode() 96 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testUtf8BytesSplitAcrossMultipleWrites() 114 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testBufferWithNonZeroOffset()
|
D | StandardCharsetsEncoderTest.java | 33 import java.nio.charset.Charset; 61 public static Charset[] getStandardCharsets() throws Exception { in getStandardCharsets() 62 List<Charset> charsets = new ArrayList<>(); in getStandardCharsets() 64 if (field.getType() == Charset.class) { in getStandardCharsets() 65 charsets.add((Charset) field.get(null)); in getStandardCharsets() 69 return charsets.toArray(new Charset[0]); in getStandardCharsets() 79 public void testCharset(Charset charset) throws Exception { in testCharset() 130 for (Charset charset : getStandardCharsets()) { in main() 214 private static String createFileName(Charset charset) { in createFileName()
|
D | SettableCharsetProvider.java | 18 import java.nio.charset.Charset; 41 public Iterator<Charset> charsets() { in charsets() 50 public Charset charsetForName(String charsetName) { in charsetForName()
|
D | OldCharsetEncoderDecoderBufferTest.java | 21 import java.nio.charset.Charset; 38 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testDecoderOutputBuffer() 70 CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder(); in testDecoderInputBuffer() 96 CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder(); in testEncoderOutputBuffer() 128 CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder(); in testEncoderInputBuffer()
|
D | Charset_TestGenerator.java | 21 import java.nio.charset.Charset; 31 Charset charset; 217 static void genEncoded (Charset charset, CharBuffer cb) { in genEncoded() 234 static void genDecoded (Charset charset, ByteBuffer bb) { in genDecoded() 256 genEncoded(Charset.forName("MacRoman"), CharBuffer.wrap(chars)); in main()
|
/libcore/ojluni/src/main/java/sun/nio/cs/ |
D | ThreadLocalCoders.java | 92 if (name instanceof Charset) 98 return Charset.forName((String)name).newDecoder(); 99 if (name instanceof Charset) 100 return ((Charset)name).newDecoder(); 116 if (name instanceof Charset) 122 return Charset.forName((String)name).newEncoder(); 123 if (name instanceof Charset) 124 return ((Charset)name).newEncoder();
|
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ |
D | InputStreamReaderTest.java | 29 import java.nio.charset.Charset; 183 Charset cs = Charset.forName("utf-8"); in test_close() 184 assertEquals(cs, Charset.forName(reader.getEncoding())); in test_close() 241 assertEquals(Charset.forName(reader2.getEncoding()), Charset in test_ConstructorLjava_io_InputStreamLjava_lang_String() 245 assertEquals(Charset.forName(reader2.getEncoding()), Charset in test_ConstructorLjava_io_InputStreamLjava_lang_String() 256 Charset cs = Charset.forName("utf-8"); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_Charset() 264 reader = new InputStreamReader(in, (Charset) null); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_Charset() 270 assertEquals(Charset.forName(reader2.getEncoding()), cs); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_Charset() 280 CharsetDecoder decoder = Charset.forName("utf-8").newDecoder(); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder() 294 assertEquals(Charset.forName(reader2.getEncoding()), decoder.charset()); in test_ConstructorLjava_io_InputStreamLjava_nio_charset_CharsetDecoder() [all …]
|
/libcore/ojluni/src/main/java/java/nio/charset/spi/ |
D | CharsetProvider.java | 28 import java.nio.charset.Charset; 95 public abstract Iterator<Charset> charsets(); in charsets() 108 public abstract Charset charsetForName(String charsetName); in charsetForName()
|
/libcore/luni/src/test/java/libcore/java/io/ |
D | OldOutputStreamWriterTest.java | 26 import java.nio.charset.Charset; 74 Charset.defaultCharset(), in test_ConstructorLjava_io_OutputStream() 75 Charset.forName(writer.getEncoding())); in test_ConstructorLjava_io_OutputStream() 118 Charset.forName("8859_1"), in test_ConstructorLjava_io_OutputStreamLjava_lang_String() 119 Charset.forName(osw.getEncoding())); in test_ConstructorLjava_io_OutputStreamLjava_lang_String() 126 Charset cs = Charset.forName("ascii"); in test_ConstructorLjava_io_OutputStreamLjava_nio_charset_Charset() 136 writer = new OutputStreamWriter(out, (Charset) null); in test_ConstructorLjava_io_OutputStreamLjava_nio_charset_Charset() 144 cs, Charset.forName(writer.getEncoding())); in test_ConstructorLjava_io_OutputStreamLjava_nio_charset_Charset() 152 Charset cs = Charset.forName("ascii"); in test_ConstructorLjava_io_OutputStreamLjava_nio_charset_CharsetEncoder() 171 cs, Charset.forName(writer.getEncoding())); in test_ConstructorLjava_io_OutputStreamLjava_nio_charset_CharsetEncoder() [all …]
|
/libcore/ojluni/src/main/java/sun/nio/fs/ |
D | Util.java | 30 import java.nio.charset.Charset; 45 private static final Charset jnuEncoding = Charset.forName("UTF-8"); 50 static Charset jnuEncoding() { in jnuEncoding()
|