Home
last modified time | relevance | path

Searched refs:cb (Results 1 – 25 of 43) sorted by relevance

12

/libcore/ojluni/src/test/java/nio/Buffer/
DChars.java54 static CharBuffer randomizeRange(CharBuffer cb) { in randomizeRange() argument
55 int mid = cb.capacity() >>> 1; in randomizeRange()
57 int end = mid + RAND.nextInt(cb.capacity() - mid + 1); // from mid to capacity in randomizeRange()
58 cb.position(start); in randomizeRange()
59 cb.limit(end); in randomizeRange()
60 return cb; in randomizeRange()
66 static CharBuffer randomize(CharBuffer cb) { in randomize() argument
67 while (cb.hasRemaining()) { in randomize()
68 cb.put((char)RAND.nextInt()); in randomize()
70 return randomizeRange(cb); in randomize()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/
DCharBufferTest.java30 CharBuffer cb = CharBuffer.allocate(32).append(s); in testChars() local
31 cb.rewind(); in testChars()
36 assertTrue(Arrays.equals(expected, cb.chars().limit(s.length()).toArray())); in testChars()
41 CharBuffer cb = CharBuffer.allocate(32).append(s); in testCodePoints() local
42 cb.rewind(); in testCodePoints()
46 assertTrue(Arrays.equals(expected, cb.codePoints().limit(s.length()).toArray())); in testCodePoints()
51 cb = CharBuffer.allocate(32).append(surrogateCP); in testCodePoints()
52 cb.rewind(); in testCodePoints()
53 assertEquals(Character.toCodePoint(high, low), cb.codePoints().toArray()[0]); in testCodePoints()
54 assertEquals((int) low, cb.codePoints().toArray()[1]); // Unmatched surrogate. in testCodePoints()
[all …]
DBufferTest.java764 CharBuffer cb = b.asCharBuffer(); in testCharBufferSubSequence() local
765 CharSequence cs = cb.subSequence(0, cb.length()); in testCharBufferSubSequence()
1514 CharBuffer cb = bb.asCharBuffer(); in testPut() local
1515 cb.put('a'); in testPut()
1516 cb.flip(); in testPut()
1517 assertEquals("a", cb.toString()); in testPut()
1519 cb.limit(3); in testPut()
1520 CharBuffer midCb = cb.slice(1,2); in testPut()
1522 cb.limit(2); in testPut()
1523 assertEquals("ab", cb.toString()); in testPut()
[all …]
/libcore/ojluni/src/main/java/java/io/
DBufferedReader.java75 private char cb[]; field in BufferedReader
106 cb = new char[sz]; in BufferedReader()
143 if (readAheadLimit <= cb.length) { in fill()
145 System.arraycopy(cb, markedChar, cb, 0, delta); in fill()
156 int nlength = cb.length * 2; in fill()
161 System.arraycopy(cb, markedChar, ncb, 0, delta); in fill()
162 cb = ncb; in fill()
172 n = in.read(cb, dst, cb.length - dst); in fill()
199 if (cb[nextChar] == '\n') { in read()
204 return cb[nextChar++]; in read()
[all …]
DConsole.java468 private char[] cb; field in Console.LineReader
473 cb = new char[1024]; in LineReader()
499 n = in.read(cb, 0, cb.length); in read()
504 if (n < cb.length && in read()
505 cb[n-1] != '\n' && cb[n-1] != '\r') { in read()
519 if (leftoverLF && cbuf == rcb && cb[nextChar] == '\n') { in read()
528 c = cbuf[off++] = cb[nextChar]; in read()
529 cb[nextChar++] = 0; in read()
554 nChars = in.read(cb, 0, cb.length); in read()
557 if (nextChar < nChars && cb[nextChar] == '\n') { in read()
DBufferedWriter.java70 private char cb[]; field in BufferedWriter
99 cb = new char[sz]; in BufferedWriter()
120 out.write(cb, 0, nextChar); in flushBuffer()
135 cb[nextChar++] = (char) c; in write()
191 System.arraycopy(cbuf, b, cb, nextChar, d); in write()
229 s.getChars(b, b + d, cb, nextChar); in write()
271 cb = null; in close()
DReader.java209 char cb[] = new char[1]; in read() local
210 if (read(cb, 0, 1) == -1) in read()
213 return cb[0]; in read()
/libcore/ojluni/src/main/java/sun/nio/cs/
DStreamEncoder.java129 public void write(CharBuffer cb) throws IOException { in write() argument
130 int position = cb.position(); in write()
134 implWrite(cb); in write()
137 cb.position(position); in write()
239 private void flushLeftoverChar(CharBuffer cb, boolean endOfInput) in flushLeftoverChar() argument
250 if ((cb != null) && cb.hasRemaining()) in flushLeftoverChar()
251 lcb.put(cb.get()); in flushLeftoverChar()
258 if (cb != null && cb.hasRemaining()) in flushLeftoverChar()
259 flushLeftoverChar(cb, endOfInput); in flushLeftoverChar()
277 CharBuffer cb = CharBuffer.wrap(cbuf, off, len); in implWrite() local
[all …]
DStreamDecoder.java129 char cb[] = new char[2]; in read0() local
130 int n = read(cb, 0, 2); in read0()
135 leftoverChar = cb[1]; in read0()
139 return cb[0]; in read0()
318 CharBuffer cb = CharBuffer.wrap(cbuf, off, end - off); in implRead() local
319 if (cb.position() != 0) in implRead()
321 cb = cb.slice(); in implRead()
325 CoderResult cr = decoder.flush(cb); in implRead()
328 return cb.position(); in implRead()
333 if (cb.position() == 0) { in implRead()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DCharBufferTest.java858 CharBuffer cb = CharBuffer.allocate(10); in testAppendSelf() local
859 CharBuffer cb2 = cb.duplicate(); in testAppendSelf()
860 cb.append(cb); in testAppendSelf()
861 assertEquals(10, cb.position()); in testAppendSelf()
862 cb.clear(); in testAppendSelf()
863 assertEquals(cb2, cb); in testAppendSelf()
865 cb.put("abc"); in testAppendSelf()
866 cb2 = cb.duplicate(); in testAppendSelf()
867 cb.append(cb); in testAppendSelf()
868 assertEquals(10, cb.position()); in testAppendSelf()
[all …]
/libcore/luni/src/test/java/libcore/java/nio/charset/
DCharsetDecoderTest.java97 CharBuffer cb = CharBuffer.allocate(128); in testUtf8BytesSplitAcrossMultipleWrites() local
99 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0xe2 }), cb, false); in testUtf8BytesSplitAcrossMultipleWrites()
101 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x98 }), cb, false); in testUtf8BytesSplitAcrossMultipleWrites()
103 cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x83 }), cb, false); in testUtf8BytesSplitAcrossMultipleWrites()
105 cr = decoder.decode(ByteBuffer.wrap(new byte[0]), cb, true); in testUtf8BytesSplitAcrossMultipleWrites()
107 cr = decoder.flush(cb); in testUtf8BytesSplitAcrossMultipleWrites()
109 assertEquals(1, cb.position()); in testUtf8BytesSplitAcrossMultipleWrites()
110 assertEquals('\u2603', cb.get(0)); in testUtf8BytesSplitAcrossMultipleWrites()
115 CharBuffer cb = CharBuffer.allocate(128); in testBufferWithNonZeroOffset() local
116 cb.position(42); in testBufferWithNonZeroOffset()
[all …]
DCharset_TestGenerator.java217 static void genEncoded (Charset charset, CharBuffer cb) { in genEncoded() argument
223 ByteBuffer bb = encoder.encode(cb); in genEncoded()
/libcore/ojluni/src/main/java/java/nio/charset/
DCharsetEncoder.java380 CharBuffer cb = CharBuffer.allocate((int)(bb.remaining() in isLegalReplacement() local
382 CoderResult cr = dec.decode(bb, cb, true); in isLegalReplacement()
948 private boolean canEncode(CharBuffer cb) { in canEncode() argument
956 if (!cb.hasRemaining()) { in canEncode()
966 encode(cb); in canEncode()
1004 CharBuffer cb = CharBuffer.allocate(1); in canEncode() local
1005 cb.put(c); in canEncode()
1006 cb.flip(); in canEncode()
1007 return canEncode(cb); in canEncode()
1036 CharBuffer cb; in canEncode() local
[all …]
/libcore/ojluni/src/main/native/
Djvm.h695 JVM_GetClassNameUTF(JNIEnv *env, jclass cb);
701 JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);
707 JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);
713 JVM_GetClassFieldsCount(JNIEnv *env, jclass cb);
716 JVM_GetClassMethodsCount(JNIEnv *env, jclass cb);
725 JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,
732 JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);
741 JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,
749 JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);
768 JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index,
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DASCIICharsetEncoderTest.java108 CharBuffer cb = CharBuffer.wrap(chars); in testEncodeMapping() local
109 ByteBuffer bb = encoder.encode(cb); in testEncodeMapping()
113 CharBuffer cb = CharBuffer.wrap("\u0080"); in testEncodeMapping() local
115 encoder.encode(cb); in testEncodeMapping()
120 cb = CharBuffer.wrap("\ud800"); in testEncodeMapping()
122 encoder.encode(cb); in testEncodeMapping()
128 cb = CharBuffer.wrap("A"); in testEncodeMapping()
130 encoder.encode(cb, bb, false); in testEncodeMapping()
132 encoder.encode(cb); in testEncodeMapping()
DCharsetDecoder2Test.java259 CharBuffer cb = decoder.decode(ByteBuffer.wrap(bytes)); in testInvalidDecoding() local
260 fail("No exception thrown on " + Arrays.toString(bytes) + " '" + cb + "'"); in testInvalidDecoding()
272 CharBuffer cb = decoder.decode(bb); in testInvalidDecoding() local
273 fail("No exception thrown on " + Arrays.toString(bytes) + " '" + cb + "'"); in testInvalidDecoding()
DCharsetTest.java683 CharBuffer cb = c1.decode(ByteBuffer.wrap("abcdefg".getBytes("iso8859-1")));
684 assertEquals("abcdefg", new String(cb.array()));
685 cb = c1.decode(ByteBuffer.wrap("".getBytes("iso8859-1")));
686 assertEquals("", new String(cb.array()));
691 CharBuffer cb = c1.decode(ByteBuffer.wrap("abcd\u5D14efg".getBytes("iso8859-1")));
693 …assertEquals(new String(cb.array()).trim(), "abcd" + new String(replacement, "iso8859-1") + "efg");
/libcore/ojluni/src/main/java/java/nio/
DCharBufferSpliterator.java67 CharBuffer cb = buffer; in forEachRemaining() local
72 action.accept(cb.getUnchecked(i++)); in forEachRemaining()
DByteBufferAsCharBuffer.java334 CharBuffer cb = CharBuffer.wrap(ca); in toString() local
338 cb.put(db); in toString()
/libcore/ojluni/src/test/java/security/KeyStore/
DKeyStoreBuilder.java104 Callback cb = callbacks[i]; in handle() local
105 if (cb instanceof PasswordCallback) { in handle()
106 PasswordCallback pcb = (PasswordCallback)cb; in handle()
DProbeKeystores.java207 Callback cb = callbacks[i]; in handle() local
208 if (cb instanceof PasswordCallback) { in handle()
209 PasswordCallback pcb = (PasswordCallback)cb; in handle()
/libcore/ojluni/src/main/java/java/util/zip/
DZipCoder.java118 CharBuffer cb = decoder().decode(ByteBuffer.wrap(a, off, len)); in checkedHash() local
119 int limit = cb.limit(); in checkedHash()
120 char[] decoded = cb.array(); in checkedHash()
/libcore/libart/src/main/java/java/lang/
DStringFactory.java102 CharBuffer cb = charset.decode(ByteBuffer.wrap(data, offset, byteCount)); in newStringFromBytes() local
103 length = cb.length(); in newStringFromBytes()
107 value = cb.array(); in newStringFromBytes()
/libcore/ojluni/src/main/java/java/lang/
DReadable.java52 public int read(java.nio.CharBuffer cb) throws IOException; in read() argument
/libcore/ojluni/src/main/java/sun/net/www/
DParseUtil.java180 CharBuffer cb = CharBuffer.allocate(n); in decode() local
212 cb.clear(); in decode()
214 CoderResult cr = dec.decode(bb, cb, true); in decode()
217 cr = dec.flush(cb); in decode()
220 sb.append(cb.flip().toString()); in decode()

12