Home
last modified time | relevance | path

Searched refs:StandardCharsets (Results 1 – 25 of 49) sorted by relevance

12

/libcore/benchmarks/src/benchmarks/regression/
DCharsetUtf8Benchmark.java21 import java.nio.charset.StandardCharsets;
55 new String(ASCII, StandardCharsets.UTF_8); in time_ascii()
59 new String(BMP2, StandardCharsets.UTF_8); in time_bmp2()
63 new String(BMP3, StandardCharsets.UTF_8); in time_bmp3()
67 new String(SUPPLEMENTARY, StandardCharsets.UTF_8); in time_supplementary()
DStringToBytesBenchmark.java21 import java.nio.charset.StandardCharsets;
62 string.value.getBytes(StandardCharsets.UTF_8); in timeGetBytesUtf8()
68 string.value.getBytes(StandardCharsets.ISO_8859_1); in timeGetBytesIso88591()
74 string.value.getBytes(StandardCharsets.US_ASCII); in timeGetBytesAscii()
/libcore/luni/src/test/java/libcore/android/system/
DUnixSocketAddressTest.java23 import java.nio.charset.StandardCharsets;
32 byte[] abstractNameBytes = path.getBytes(StandardCharsets.UTF_8); in testFilesystemSunPath()
47 byte[] abstractNameBytes = abstractName.getBytes(StandardCharsets.UTF_8); in testAbstractSunPath()
DOsTest.java52 import java.nio.charset.StandardCharsets;
200 String s = new String(request, StandardCharsets.UTF_8); in checkUnixDomainSocket()
201 byte[] response = s.toUpperCase(Locale.ROOT).getBytes(StandardCharsets.UTF_8); in checkUnixDomainSocket()
219 byte[] request = string.getBytes(StandardCharsets.UTF_8); in checkUnixDomainSocket()
225 assertEquals(string.toUpperCase(Locale.ROOT), new String(response, StandardCharsets.UTF_8)); in checkUnixDomainSocket()
261 final byte[] contents = "goodbye, cruel world".getBytes(StandardCharsets.US_ASCII); in test_byteBufferPositions_write_pwrite()
354 .getBytes(StandardCharsets.US_ASCII); in checkByteBufferPositions_sendto_recvfrom()
720 new String(requestBuf, 0, len, StandardCharsets.UTF_8); in createVmSocketEchoServer()
722 request.toUpperCase(Locale.ROOT).getBytes(StandardCharsets.UTF_8); in createVmSocketEchoServer()
753 final byte[] requestBuf = request.getBytes(StandardCharsets.UTF_8);
[all …]
/libcore/ojluni/src/main/java/java/nio/charset/
DStandardCharsets.java35 public final class StandardCharsets { class
37 private StandardCharsets() { in StandardCharsets() method in StandardCharsets
/libcore/luni/src/main/java/android/system/
DUnixSocketAddress.java24 import java.nio.charset.StandardCharsets;
76 byte[] nameBytes = name.getBytes(StandardCharsets.UTF_8); in createAbstract()
97 byte[] pathNameBytes = pathName.getBytes(StandardCharsets.UTF_8); in createFileSystem()
/libcore/ojluni/src/main/java/java/util/zip/
DZipCoder.java31 import java.nio.charset.StandardCharsets;
110 utf8 = new ZipCoder(StandardCharsets.UTF_8); in getBytesUTF8()
119 utf8 = new ZipCoder(StandardCharsets.UTF_8); in toStringUTF8()
135 this.isUTF8 = cs.name().equals(StandardCharsets.UTF_8.name()); in ZipCoder()
DZipEntry.java30 import java.nio.charset.StandardCharsets;
128 if (name.getBytes(StandardCharsets.UTF_8).length > 0xffff) { in ZipEntry()
130 name.getBytes(StandardCharsets.UTF_8).length); in ZipEntry()
581 if (comment != null && comment.getBytes(StandardCharsets.UTF_8).length > 0xffff) { in setComment()
583 comment.getBytes(StandardCharsets.UTF_8).length); in setComment()
DZipInputStream.java34 import java.nio.charset.StandardCharsets;
81 this(in, StandardCharsets.UTF_8); in ZipInputStream()
/libcore/support/src/test/java/libcore/testing/io/
DTestIoUtils.java21 import java.nio.charset.StandardCharsets;
35 return new String(Files.readAllBytes(Paths.get(absolutePath)), StandardCharsets.UTF_8); in readFileAsString()
/libcore/ojluni/src/main/java/javax/net/ssl/
DSNIHostName.java31 import java.nio.charset.StandardCharsets;
103 .getBytes(StandardCharsets.US_ASCII)); in SNIHostName()
171 CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder() in SNIHostName()
/libcore/metrictests/memory/apps/src/libcore/heapdumper/
DPssInstrumentation.java29 import java.nio.charset.StandardCharsets;
45 Charset cs = StandardCharsets.UTF_8; in takeMeasurement()
/libcore/luni/src/test/java/libcore/java/nio/charset/
DStandardCharsetsEncoderTest.java36 import java.nio.charset.StandardCharsets;
63 for (Field field : StandardCharsets.class.getFields()) { in getStandardCharsets()
207 return new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.US_ASCII)); in createAsciiWriter()
211 return new BufferedReader(new InputStreamReader(in, StandardCharsets.US_ASCII)); in createAsciiReader()
DCharsetEncoderTest.java26 import java.nio.charset.StandardCharsets;
222 CharsetEncoder encoder = StandardCharsets.UTF_8.newEncoder();
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DFileInputStreamTest.java26 import java.nio.charset.StandardCharsets;
101 fos.write(INPUT.getBytes(StandardCharsets.US_ASCII)); in setUp()
234 new String(buf1, 0, buf1.length, StandardCharsets.US_ASCII)); in test_read$B()
247 new String(buf1, 0, buf1.length, StandardCharsets.US_ASCII)); in test_read$BII()
391 new String(buf1, 0, buf1.length, StandardCharsets.US_ASCII)); in test_skipJ()
DFileDescriptorTest.java26 import java.nio.charset.StandardCharsets;
40 fos.write("Test String".getBytes(StandardCharsets.US_ASCII)); in test_sync()
DFilterInputStreamTest.java26 import java.nio.charset.StandardCharsets;
102 fos.write(INPUT.getBytes(StandardCharsets.US_ASCII)); in setUp()
DPrintStreamTest.java32 import java.nio.charset.StandardCharsets;
103 assertFileContents(UNICODE_STRING.getBytes(StandardCharsets.UTF_8), testFile); in test_Constructor_Ljava_lang_String_Ljava_lang_String()
110 assertFileContents(UNICODE_STRING.getBytes(StandardCharsets.UTF_16), testFile); in test_Constructor_Ljava_lang_String_Ljava_lang_String()
160 assertByteArraysEqual(UNICODE_STRING.getBytes(StandardCharsets.UTF_8), in test_ConstructorLjava_io_OutputStreamZLjava_lang_String()
169 assertByteArraysEqual(UNICODE_STRING.getBytes(StandardCharsets.UTF_16), in test_ConstructorLjava_io_OutputStreamZLjava_lang_String()
686 byte[] bytes = "Line without a newline".getBytes(StandardCharsets.UTF_8); in test_autoFlush_flushesEverything()
704 byte[] bytes = "Line without a newline".getBytes(StandardCharsets.UTF_8); in test_noAutoFlush()
/libcore/luni/src/main/java/org/xml/sax/helpers/
DXMLReaderFactory.java18 import java.nio.charset.StandardCharsets;
133 reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8)); in createXMLReader()
/libcore/luni/src/test/java/libcore/libcore/util/
DHexEncodingTest.java19 import java.nio.charset.StandardCharsets;
57 { "avocados".getBytes(StandardCharsets.UTF_8), "61766F6361646F73" }, in testEncodeBytes()
/libcore/luni/src/test/java/libcore/java/nio/file/
DFiles2Test.java36 import java.nio.charset.StandardCharsets;
927 Files.write(filesSetup.getDataFilePath(), lines, StandardCharsets.UTF_16); in test_lines$Path$Charset()
929 StandardCharsets.UTF_16)) { in test_lines$Path$Charset()
937 StandardCharsets.UTF_16)) { in test_lines$Path$Charset()
947 StandardCharsets.UTF_16)) { in test_lines$Path$Charset()
955 Files.lines(null, StandardCharsets.UTF_16); in test_lines$Path$Charset_NPE()
970 Files.write(filesSetup.getDataFilePath(), lines, StandardCharsets.UTF_8); in test_lines$Path()
1086 StandardCharsets.US_ASCII); in test_newBufferedReader$Path$Charset()
1092 StandardCharsets.US_ASCII); in test_newBufferedReader$Path$Charset()
1102 Files.newBufferedReader(null, StandardCharsets.US_ASCII); in test_newBufferedReader$Path$Charset_NPE()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DLibcoreIoDerivedBase64Test.java26 import java.nio.charset.StandardCharsets;
224 CharsetDecoder decoder = StandardCharsets.US_ASCII.newDecoder(); in bytesToAscii()
243 CharsetEncoder encoder = StandardCharsets.US_ASCII.newEncoder(); in asciiToBytes()
/libcore/luni/src/test/java/libcore/java/util/zip/
DGZIPInputStreamTest.java27 import java.nio.charset.StandardCharsets;
148 assertEquals("Hello World", new String(unzipped, StandardCharsets.UTF_8)); in testTrailingHeaderAndPartialMember()
/libcore/luni/src/test/java/libcore/javax/crypto/
DMacTest.java19 import static java.nio.charset.StandardCharsets.UTF_8;
/libcore/ojluni/src/main/java/java/nio/file/
DFiles.java46 import java.nio.charset.StandardCharsets;
2816 return newBufferedReader(path, StandardCharsets.UTF_8);
2896 return newBufferedWriter(path, StandardCharsets.UTF_8, options);
3242 return readAllLines(path, StandardCharsets.UTF_8);
3397 return write(path, lines, StandardCharsets.UTF_8, options);
3785 return lines(path, StandardCharsets.UTF_8);

12