Home
last modified time | relevance | path

Searched refs:chars (Results 1 – 25 of 80) sorted by relevance

1234

/libcore/benchmarks/src/benchmarks/regression/
DCharacterBenchmark.java32 private char[] chars; field in CharacterBenchmark
36 this.chars = characterSet.chars; in setUp()
48 final char[] chars; field in CharacterBenchmark.CharacterSet
50 this.chars = new char[65536]; in CharacterSet()
52 chars[i] = (char) (i % size); in CharacterSet()
80 Character.digit(chars[ch], 10); in timeDigit()
86 Character.digit((int) chars[ch], 10); in timeDigit()
96 Character.getNumericValue(chars[ch]); in timeGetNumericValue()
102 Character.getNumericValue((int) chars[ch]); in timeGetNumericValue()
112 Character.isDigit(chars[ch]); in timeIsDigit()
[all …]
DStringToBytesBenchmark.java43 char[] chars = new char[length]; in makeString() local
45 chars[i] = (char) i; in makeString()
47 return new String(chars); in makeString()
51 char[] chars = new char[length]; in makeAsciiString() local
53 chars[i] = ((i & 0x7f) != 0) ? (char) (i & 0x7f) : '?'; in makeAsciiString()
55 return new String(chars); in makeAsciiString()
/libcore/luni/src/test/java/libcore/java/awt/font/
DNumericShaperTest.java38 char[] chars = input.toCharArray(); in testShape() local
39 ns.shape(chars, 0, chars.length); in testShape()
40 assertEquals(expected, new String(chars)); in testShape()
42 chars = input.toCharArray(); in testShape()
43 ns.shape(chars, 0, chars.length, NumericShaper.EUROPEAN); in testShape()
44 assertEquals(expected, new String(chars)); in testShape()
46 chars = input.toCharArray(); in testShape()
47 ns.shape(chars, 0, chars.length, Range.EUROPEAN); in testShape()
48 assertEquals(expected, new String(chars)); in testShape()
/libcore/ojluni/src/main/java/java/util/concurrent/
DHelpers.java82 final char[] chars = new char[charLength + 2 * size]; in toString() local
83 chars[0] = '['; in toString()
87 chars[j++] = ','; in toString()
88 chars[j++] = ' '; in toString()
92 s.getChars(0, len, chars, j); in toString()
95 chars[j] = ']'; in toString()
97 return new String(chars); in toString()
104 final char[] chars = in mapEntryToString() local
107 k.getChars(0, klen, chars, 0); in mapEntryToString()
108 chars[klen] = '='; in mapEntryToString()
[all …]
/libcore/ojluni/src/main/java/java/util/
DStringJoiner.java150 private static int getChars(String s, char[] chars, int start) { in getChars() argument
152 s.getChars(0, len, chars, start); in getChars()
177 final char[] chars = new char[len + addLen]; in toString() local
178 int k = getChars(prefix, chars, 0); in toString()
180 k += getChars(elts[0], chars, k); in toString()
182 k += getChars(delimiter, chars, k); in toString()
183 k += getChars(elts[i], chars, k); in toString()
186 k += getChars(suffix, chars, k); in toString()
187 return new String(chars); in toString()
242 final char[] chars = new char[len]; in compactElts() local
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOldInputStreamReaderTest.java118 char[] chars = new char[source.length()]; in testReadcharArrayintint() local
119 assertEquals(0, reader.read(chars, 0, 0)); in testReadcharArrayintint()
120 assertEquals(0, chars[0]); in testReadcharArrayintint()
121 assertEquals(3, reader.read(chars, 0, 3)); in testReadcharArrayintint()
122 assertEquals(5, reader.read(chars, 3, 5)); in testReadcharArrayintint()
123 assertEquals(source.length() - 8, reader.read(chars, 8, in testReadcharArrayintint()
124 chars.length - 8)); in testReadcharArrayintint()
125 assertTrue(Arrays.equals(chars, source.toCharArray())); in testReadcharArrayintint()
126 assertEquals(-1, reader.read(chars, 0, chars.length)); in testReadcharArrayintint()
127 assertTrue(Arrays.equals(chars, source.toCharArray())); in testReadcharArrayintint()
[all …]
DOldOutputStreamWriterTest.java294 char[] chars = new char[maxChar]; in testEncodeCharset() local
296 chars[i] = (char) i; in testEncodeCharset()
302 charsOut.write(chars); in testEncodeCharset()
339 char[] chars = testString.toCharArray(); in test_write$CII() local
347 writer.write(chars, -1, 1); in test_write$CII()
354 writer.write(chars, 0, -1); in test_write$CII()
375 writer.write(chars, 1, chars.length); in test_write$CII()
381 writer.write(chars, 0, chars.length + 1); in test_write$CII()
387 writer.write(chars, chars.length, 1); in test_write$CII()
393 writer.write(chars, chars.length + 1, 0); in test_write$CII()
[all …]
DDataOutputStreamTest.java94 char[] chars = new char[65535 - 1 - 2]; in test_writeUTF() local
95 Arrays.fill(chars, 0, chars.length, 'a'); in test_writeUTF()
96 chars[0] = '\u0666'; // a two-byte character in test_writeUTF()
97 chars[1] = '\u2603'; // a three-byte character in test_writeUTF()
98 String maxLength = new String(chars); in test_writeUTF()
DOldBufferedReaderTest.java108 char[] chars = new char[256]; in test_markI() local
110 chars[i] = (char) i; in test_markI()
112 chars)), 12); in test_markI()
124 in = new BufferedReader(new Support_StringReader(new String(chars)), 12); in test_markI()
156 char[] chars = new char[256]; in test_read() local
158 chars[i] = (char) i; in test_read()
160 chars)), 12); in test_read()
167 .equals(new String(chars, 1, 14))); in test_read()
356 char[] chars = new char[1]; in test_readLine_interaction_with_array_read_2() local
357 assertEquals(1, r.read(chars, 0, 1)); // This read skips the '\n'. in test_readLine_interaction_with_array_read_2()
[all …]
DOutputStreamWriterTest.java36 char[] chars = new char[16*1024]; in testFlushCount() local
37 Arrays.fill(chars, 'x'); in testFlushCount()
39 writer.write(chars); in testFlushCount()
/libcore/luni/src/test/java/libcore/java/lang/reflect/
DArrayTest.java25 private static char[] chars; field in ArrayTest
36 chars = new char[] { '\uffff' }; in setUp()
47 try { Array.getBoolean(chars, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean()
59 try { Array.getByte(chars, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetByte()
71 assertEquals(chars[0], Array.getChar(chars, 0)); in testGetChar()
83 assertEquals((double) chars[0], Array.getDouble(chars, 0)); in testGetDouble()
95 assertEquals((float) chars[0], Array.getFloat(chars, 0)); in testGetFloat()
107 assertEquals((int) chars[0], Array.getInt(chars, 0)); in testGetInt()
119 assertEquals((long) chars[0], Array.getLong(chars, 0)); in testGetLong()
131 try { Array.getShort(chars, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetShort()
[all …]
/libcore/ojluni/src/test/java/io/Reader/
DTransferTo.java149 private static void checkTransferredContents(char[] chars) in checkTransferredContents() argument
151 try (Reader in = input(chars); in checkTransferredContents()
156 if (!Arrays.equals(chars, outChars)) { in checkTransferredContents()
159 chars.length, outChars.length)); in checkTransferredContents()
165 char[] chars = new char[min + generator.nextInt(maxRandomAdditive)]; in createRandomChars() local
166 for (int index=0; index<chars.length; index++) { in createRandomChars()
167 chars[index] = (char)generator.nextInt(); in createRandomChars()
169 return chars; in createRandomChars()
188 public void write(char[] chars, int off, int len) throws IOException { in output() argument
190 write(chars[off + i]); in output()
[all …]
/libcore/benchmarks/src/benchmarks/
DStringIterationBenchmark.java45 char[] chars = s.toCharArray(); in timeStringIteration2() local
46 for (int i = 0, length = chars.length; i < length; ++i) { in timeStringIteration2()
47 ch = chars[i]; in timeStringIteration2()
54 char[] chars = s.toCharArray(); in timeStringToCharArray() local
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DInputStreamReaderTest.java457 char[] chars = new char[source.length()]; in test_read$CII() local
458 assertEquals(source.length() - 3, isr.read(chars, 0, chars.length - 3)); in test_read$CII()
459 assertEquals(3, isr.read(chars, 0, 10)); in test_read$CII()
505 char[] chars = new char[source.length()]; in test_read$CII_1() local
506 assertEquals(0, reader.read(chars, 0, 0)); in test_read$CII_1()
507 assertEquals(0, chars[0]); in test_read$CII_1()
508 assertEquals(3, reader.read(chars, 0, 3)); in test_read$CII_1()
509 assertEquals(5, reader.read(chars, 3, 5)); in test_read$CII_1()
510 assertEquals(source.length() - 8, reader.read(chars, 8, in test_read$CII_1()
511 chars.length - 8)); in test_read$CII_1()
[all …]
DPushbackReaderTest.java221 char chars[] = new char[] { 'h', 'e', 'l', 'l', 'o' }; in test_skip$J() local
226 reader = new StringReader(new String(chars)); in test_skip$J()
227 reader2 = new StringReader(new String(chars)); in test_skip$J()
230 reader = new FilterReader(new StringReader(new String(chars))) { in test_skip$J()
232 reader2 = new FilterReader(new StringReader(new String(chars))) { in test_skip$J()
236 reader = new CharArrayReader(chars); in test_skip$J()
237 reader2 = new CharArrayReader(chars); in test_skip$J()
DBufferedReaderTest.java128 char[] chars = new char[256]; in test_markI() local
130 chars[i] = (char) i; in test_markI()
132 chars)), 12); in test_markI()
141 in = new BufferedReader(new Support_StringReader(new String(chars)), 12); in test_markI()
202 char[] chars = new char[256]; in test_read() local
204 chars[i] = (char) i; in test_read()
206 chars)), 12); in test_read()
213 .equals(new String(chars, 1, 14))); in test_read()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DPropertyResourceBundleTest.java77 char[] chars = new char[cbuffer.limit()]; in test_ConstructorLjava_io_Reader() local
78 cbuffer.get(chars); in test_ConstructorLjava_io_Reader()
80 prb = new PropertyResourceBundle(new CharArrayReader(chars)); in test_ConstructorLjava_io_Reader()
87 chars = new char[cbuffer.limit()]; in test_ConstructorLjava_io_Reader()
88 cbuffer.get(chars); in test_ConstructorLjava_io_Reader()
90 prb = new PropertyResourceBundle(new CharArrayReader(chars)); in test_ConstructorLjava_io_Reader()
/libcore/ojluni/src/main/java/sun/nio/fs/
DUnixUriUtils.java135 private static long lowMask(String chars) { in lowMask() argument
136 int n = chars.length(); in lowMask()
139 char c = chars.charAt(i); in lowMask()
147 private static long highMask(String chars) { in highMask() argument
148 int n = chars.length(); in highMask()
151 char c = chars.charAt(i); in highMask()
/libcore/ojluni/src/test/java/lang/String/concat/
DImplicitStringConcat.java114 static char[] chars = new char[] {'a'}; field in ImplicitStringConcat
158 sb.append(Integer.toHexString(System.identityHashCode(chars))); in testImplicitStringConcat()
159 test(sb.toString(), s + chars); in testImplicitStringConcat() local
185 sb.append(Integer.toHexString(System.identityHashCode(chars))); in testImplicitStringConcat()
187 s += chars; in testImplicitStringConcat()
/libcore/ojluni/src/main/native/
Dio_util_md.c66 char* chars = malloc(ulen); in newStringPlatform() local
67 if (chars == NULL) { in newStringPlatform()
71 if (CFStringGetCString(csref, chars, ulen, kCFStringEncodingUTF16)) { in newStringPlatform()
72 rv = (*env)->NewString(env, (jchar*)chars, clen); in newStringPlatform()
74 free(chars); in newStringPlatform()
Djni_util_md.c41 void nativeReleaseStringPlatformChars(JNIEnv* env, jstring jstr, const char* chars) { in nativeReleaseStringPlatformChars() argument
42 (*env)->ReleaseStringUTFChars(env, jstr, chars); in nativeReleaseStringPlatformChars()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DCharsetEncoder2Test.java187 CharBuffer chars = utf8.newDecoder().decode(bytes); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB() local
189 assertEquals(2, chars.limit()); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
190 assertEquals(0xd800, chars.get(0)); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
191 assertEquals(0xdc00, chars.get(1)); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
/libcore/ojluni/src/test/java/net/URLEncoder/
DURLEncodeDecode.java40 static char chars[] = {'H', 'e', 'l', 'l', 'o', field in URLEncodeDecode
47 static String str = new String(chars);
/libcore/luni/src/test/java/libcore/java/util/
DLibcoreIoDerivedBase64Test.java229 char[] chars = new char[charsBuffer.remaining()]; in bytesToAscii() local
230 charsBuffer.get(chars, 0, chars.length); in bytesToAscii()
231 return new String(chars); in bytesToAscii()
241 char[] chars = string.toCharArray(); in asciiToBytes() local
246 CharBuffer charsBuffer = CharBuffer.wrap(chars); in asciiToBytes()
/libcore/luni/src/main/java/libcore/internal/
DStringPool.java33 private static boolean contentEquals(String s, char[] chars, int start, int length) { in contentEquals() argument
38 if (chars[start + i] != s.charAt(i)) { in contentEquals()

1234