Home
last modified time | relevance | path

Searched refs:Charset (Results 1 – 25 of 129) sorted by relevance

123456

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DCharsetTest.java22 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 …]
DCharsetEncoder2Test.java23 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 …]
DCharsetDecoder2Test.java24 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 …]
DAbstractCharsetTestCase.java22 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()
/libcore/ojluni/src/main/java/java/nio/charset/
DStandardCharsets.java52 public static final Charset US_ASCII = Charset.forName("US-ASCII");
58 public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
63 public static final Charset UTF_8 = Charset.forName("UTF-8");
68 public static final Charset UTF_16BE = Charset.forName("UTF-16BE");
73 public static final Charset UTF_16LE = Charset.forName("UTF-16LE");
79 public static final Charset UTF_16 = Charset.forName("UTF-16");
DCharset.java283 public abstract class Charset class
284 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()
405 private static Charset lookupViaProviders(final String charsetName) { in lookupViaProviders()
426 public Charset run() { in lookupViaProviders()
430 Charset cs = cp.charsetForName(charsetName); in lookupViaProviders()
486 private static Charset lookup(String charsetName) {
[all …]
/libcore/ojluni/src/test/java/nio/charset/Charset/
DContains.java30 package test.java.nio.charset.Charset;
37 static void ck(Charset cs1, Charset cs2, boolean cont) throws Exception { in ck()
48 Charset us_ascii = Charset.forName("US-ASCII"); in main()
49 Charset iso_8859_1 = Charset.forName("ISO-8859-1"); in main()
50 Charset iso_8859_15 = Charset.forName("ISO-8859-15"); in main()
51 Charset utf_8 = Charset.forName("UTF-8"); in main()
52 Charset utf_16be = Charset.forName("UTF-16BE"); in main()
53 Charset cp1252 = Charset.forName("CP1252"); in main()
103 ck(Charset.forName(utfName), in checkUTF()
104 Charset.forName(csName), in checkUTF()
DIllegalCharsetName.java29 package test.java.nio.charset.Charset;
49 Charset.forName(illegalNames[i]); in main()
55 Charset.isSupported(illegalNames[i]); in main()
68 private static void checkAliases(Charset cs) { in checkAliases()
70 Charset.forName(alias); in checkAliases()
71 Charset.isSupported(alias); in checkAliases()
DEmptyCharsetName.java29 package test.java.nio.charset.Charset;
63 Charset.forName(""); in main()
67 Charset.isSupported(""); in main()
71 new Charset("", new String[] { }) { in main()
78 public boolean contains(Charset cs) { in main()
DEncDec.java28 package test.java.nio.charset.Charset;
39 bb.put(Charset.forName("ISO-8859-15").encode(s)).flip(); in main()
40 String t = Charset.forName("UTF-8").decode(bb).toString(); in main()
/libcore/ojluni/annotations/hiddenapi/java/nio/charset/
DCharset.java32 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 …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DStringTest.java22 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/
DCharsetTest.java19 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()
DCharsetEncoderTest.java21 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()
DCharsetDecoderTest.java22 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()
DStandardCharsetsEncoderTest.java33 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()
DSettableCharsetProvider.java18 import java.nio.charset.Charset;
41 public Iterator<Charset> charsets() { in charsets()
50 public Charset charsetForName(String charsetName) { in charsetForName()
DOldCharsetEncoderDecoderBufferTest.java21 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()
/libcore/ojluni/src/main/java/sun/nio/cs/
DThreadLocalCoders.java92 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/ojluni/src/main/java/java/io/
DFileWriter.java28 import java.nio.charset.Charset;
140 public FileWriter(String fileName, Charset charset) throws IOException { in FileWriter()
159 public FileWriter(String fileName, Charset charset, boolean append) throws IOException { in FileWriter()
175 public FileWriter(File file, Charset charset) throws IOException { in FileWriter()
193 public FileWriter(File file, Charset charset, boolean append) throws IOException { in FileWriter()
DFileReader.java28 import java.nio.charset.Charset;
102 public FileReader(String fileName, Charset charset) throws IOException { in FileReader()
119 public FileReader(File file, Charset charset) throws IOException { in FileReader()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DInputStreamReaderTest.java29 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/luni/src/test/java/libcore/java/io/
DOldOutputStreamWriterTest.java26 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/java/nio/charset/spi/
DCharsetProvider.java28 import java.nio.charset.Charset;
100 public abstract Iterator<Charset> charsets(); in charsets()
113 public abstract Charset charsetForName(String charsetName); in charsetForName()
/libcore/ojluni/src/test/java/io/FileWriter/
DConstructorTest.java32 import java.nio.charset.Charset;
85 void test(ConstructorType type, File file1, File file2, Charset charset) in test()
117 FileReader getFileReader(ConstructorType type, File file, Charset charset) in getFileReader()
134 FileWriter getFileWriter(ConstructorType type, File file, Charset charset) in getFileWriter()
150 void writeWithFileWriter(ConstructorType type, File file, String content, Charset charset) in writeWithFileWriter()
162 … void writeWithOutputStreamWriter(ConstructorType type, File file, String content, Charset charset) in writeWithOutputStreamWriter()

123456