Home
last modified time | relevance | path

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

12

/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 …]
/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.java407 private char[] cb; field in Console.LineReader
412 cb = new char[1024]; in LineReader()
438 n = in.read(cb, 0, cb.length); in read()
443 if (n < cb.length && in read()
444 cb[n-1] != '\n' && cb[n-1] != '\r') { in read()
458 if (leftoverLF && cbuf == rcb && cb[nextChar] == '\n') { in read()
467 c = cbuf[off++] = cb[nextChar]; in read()
468 cb[nextChar++] = 0; in read()
493 nChars = in.read(cb, 0, cb.length); in read()
496 if (nextChar < nChars && cb[nextChar] == '\n') { in read()
DBufferedWriter.java70 private char cb[]; field in BufferedWriter
105 cb = new char[sz]; in BufferedWriter()
129 out.write(cb, 0, nextChar); in flushBuffer()
144 cb[nextChar++] = (char) c; in write()
195 System.arraycopy(cbuf, b, cb, nextChar, d); in write()
226 s.getChars(b, b + d, cb, nextChar); in write()
268 cb = null; in close()
DReader.java120 char cb[] = new char[1]; in read() local
121 if (read(cb, 0, 1) == -1) in read()
124 return cb[0]; in read()
/libcore/ojluni/src/main/java/sun/nio/cs/
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 …]
DStreamEncoder.java227 private void flushLeftoverChar(CharBuffer cb, boolean endOfInput) in flushLeftoverChar() argument
238 if ((cb != null) && cb.hasRemaining()) in flushLeftoverChar()
239 lcb.put(cb.get()); in flushLeftoverChar()
246 if (cb != null && cb.hasRemaining()) in flushLeftoverChar()
247 flushLeftoverChar(cb, endOfInput); in flushLeftoverChar()
265 CharBuffer cb = CharBuffer.wrap(cbuf, off, len); in implWrite() local
268 flushLeftoverChar(cb, false); in implWrite()
270 while (cb.hasRemaining()) { in implWrite()
271 CoderResult cr = encoder.encode(cb, bb, false); in implWrite()
273 assert (cb.remaining() <= 1) : cb.remaining(); in implWrite()
[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.java370 CharBuffer cb = CharBuffer.allocate((int)(bb.remaining() in isLegalReplacement() local
372 CoderResult cr = dec.decode(bb, cb, true); in isLegalReplacement()
919 private boolean canEncode(CharBuffer cb) { in canEncode() argument
927 if (!cb.hasRemaining()) { in canEncode()
937 encode(cb); in canEncode()
975 CharBuffer cb = CharBuffer.allocate(1); in canEncode() local
976 cb.put(c); in canEncode()
977 cb.flip(); in canEncode()
978 return canEncode(cb); in canEncode()
1007 CharBuffer cb; in canEncode() local
[all …]
DCharset.java887 public final ByteBuffer encode(CharBuffer cb) {
892 .encode(cb);
/libcore/ojluni/src/main/java/java/util/zip/
DZipCoder.java62 CharBuffer cb = CharBuffer.wrap(ca); in toString() local
63 CoderResult cr = cd.decode(bb, cb, true); in toString()
66 cr = cd.flush(cb); in toString()
69 return new String(ca, 0, cb.position()); in toString()
92 CharBuffer cb = CharBuffer.wrap(ca); in getBytes() local
93 CoderResult cr = ce.encode(cb, bb, true); in getBytes()
/libcore/ojluni/src/main/native/
Djvm.h692 JVM_GetClassNameUTF(JNIEnv *env, jclass cb);
698 JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);
704 JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);
710 JVM_GetClassFieldsCount(JNIEnv *env, jclass cb);
713 JVM_GetClassMethodsCount(JNIEnv *env, jclass cb);
722 JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,
729 JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);
738 JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,
746 JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);
765 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.java167 CharBuffer cb = CharBuffer.wrap(ca); in toString() local
171 cb.put(db); in toString()
/libcore/ojluni/src/main/java/java/lang/
DReadable.java52 public int read(java.nio.CharBuffer cb) throws IOException; in read() argument
/libcore/libart/src/main/java/java/lang/
DStringFactory.java238 CharBuffer cb = charset.decode(ByteBuffer.wrap(data, offset, byteCount)); in newStringFromBytes() local
239 length = cb.length(); in newStringFromBytes()
243 value = cb.array(); in newStringFromBytes()
/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()
/libcore/ojluni/annotations/hiddenapi/java/io/
DConsole.java136 private char[] cb; field in Console.LineReader
/libcore/ojluni/annotations/hiddenapi/java/nio/charset/
DCharsetEncoder.java142 private boolean canEncode(java.nio.CharBuffer cb) { in canEncode() argument
DCharset.java128 public final java.nio.ByteBuffer encode(java.nio.CharBuffer cb) { in encode() argument

12