Home
last modified time | relevance | path

Searched refs:b (Results 1 – 25 of 627) sorted by relevance

12345678910>>...26

/libcore/ojluni/src/test/java/nio/Buffer/
DBasicChar.java71 private static void relGet(CharBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((char)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(CharBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((char)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(CharBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasicByte.java71 private static void relGet(ByteBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((byte)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(ByteBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((byte)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(ByteBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasicFloat.java71 private static void relGet(FloatBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((float)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(FloatBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((float)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(FloatBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasicDouble.java71 private static void relGet(DoubleBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((double)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(DoubleBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((double)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(DoubleBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasicLong.java71 private static void relGet(LongBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((long)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(LongBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((long)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(LongBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasicInt.java71 private static void relGet(IntBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((int)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(IntBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((int)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(IntBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasicShort.java71 private static void relGet(ShortBuffer b) { in relGet() argument
72 int n = b.capacity(); in relGet()
74 ck(b, (long)b.get(), (long)((short)ic(i))); in relGet()
75 b.rewind(); in relGet()
78 private static void relGet(ShortBuffer b, int start) { in relGet() argument
79 int n = b.remaining(); in relGet()
81 ck(b, (long)b.get(), (long)((short)ic(i))); in relGet()
82 b.rewind(); in relGet()
85 private static void absGet(ShortBuffer b) { in absGet() argument
86 int n = b.capacity(); in absGet()
[all …]
DBasic-X.java.template71 private static void relGet($Type$Buffer b) {
72 int n = b.capacity();
74 ck(b, (long)b.get(), (long)(($type$)ic(i)));
75 b.rewind();
78 private static void relGet($Type$Buffer b, int start) {
79 int n = b.remaining();
81 ck(b, (long)b.get(), (long)(($type$)ic(i)));
82 b.rewind();
85 private static void absGet($Type$Buffer b) {
86 int n = b.capacity();
[all …]
DBasic.java53 static String toString(Buffer b) { in toString() argument
54 return (b.getClass().getName() in toString()
55 + "[pos=" + b.position() in toString()
56 + " lim=" + b.limit() in toString()
57 + " cap=" + b.capacity() in toString()
65 static void fail(String s, Buffer b) { in fail() argument
66 throw new RuntimeException(s + ": " + toString(b)); in fail()
69 static void fail(String s, Buffer b, Buffer b2) { in fail() argument
71 + toString(b) + ", " + toString(b2)); in fail()
74 static void fail(Buffer b, in fail() argument
[all …]
/libcore/ojluni/src/main/java/java/io/
DBits.java39 static boolean getBoolean(byte[] b, int off) { in getBoolean() argument
40 return b[off] != 0; in getBoolean()
43 static char getChar(byte[] b, int off) { in getChar() argument
44 return (char) ((b[off + 1] & 0xFF) + in getChar()
45 (b[off] << 8)); in getChar()
48 static short getShort(byte[] b, int off) { in getShort() argument
49 return (short) ((b[off + 1] & 0xFF) + in getShort()
50 (b[off] << 8)); in getShort()
53 static int getInt(byte[] b, int off) { in getInt() argument
54 return ((b[off + 3] & 0xFF) ) + in getInt()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DZipUtils.java168 public static final int get16(byte b[], int off) { in get16() argument
169 return (b[off] & 0xff) | ((b[off + 1] & 0xff) << 8); in get16()
176 public static final long get32(byte b[], int off) { in get32() argument
177 return (get16(b, off) | ((long)get16(b, off+2) << 16)) & 0xffffffffL; in get32()
184 public static final long get64(byte b[], int off) { in get64() argument
185 return get32(b, off) | (get32(b, off+4) << 32); in get64()
193 public static final int get32S(byte b[], int off) { in get32S() argument
194 return (get16(b, off) | (get16(b, off+2) << 16)); in get32S()
198 static final int CH(byte[] b, int n) { in CH() argument
199 return b[n] & 0xff ; in CH()
[all …]
/libcore/ojluni/src/main/native/
Dzip_util.h66 #define CH(b, n) (((unsigned char *)(b))[n]) argument
67 #define SH(b, n) (CH(b, n) | (CH(b, n+1) << 8)) argument
68 #define LG(b, n) ((SH(b, n) | (SH(b, n+2) << 16)) &0xffffffffUL) argument
69 #define LL(b, n) (((jlong)LG(b, n)) | (((jlong)LG(b, n+4)) << 32)) argument
70 #define GETSIG(b) LG(b, 0) argument
75 #define LOCVER(b) SH(b, 4) /* version needed to extract */ argument
76 #define LOCFLG(b) SH(b, 6) /* general purpose bit flags */ argument
77 #define LOCHOW(b) SH(b, 8) /* compression method */ argument
78 #define LOCTIM(b) LG(b, 10) /* modification time */ argument
79 #define LOCCRC(b) LG(b, 14) /* crc of uncompressed data */ argument
[all …]
Djlong_md.h35 #define jlong_add(a, b) ((a) + (b)) argument
36 #define jlong_and(a, b) ((a) & (b)) argument
37 #define jlong_div(a, b) ((a) / (b)) argument
38 #define jlong_mul(a, b) ((a) * (b)) argument
41 #define jlong_or(a, b) ((a) | (b)) argument
44 #define jlong_sub(a, b) ((a) - (b)) argument
45 #define jlong_xor(a, b) ((a) ^ (b)) argument
46 #define jlong_rem(a,b) ((a) % (b)) argument
53 #define jlong_eq(a, b) ((a) == (b)) argument
54 #define jlong_ne(a,b) ((a) != (b)) argument
[all …]
/libcore/luni/src/test/java/libcore/java/nio/
DBufferTest.java74 private void testByteSwappedBulkGet(ByteBuffer b) throws Exception { in testByteSwappedBulkGet() argument
75 for (int i = 0; i < b.limit(); ++i) { in testByteSwappedBulkGet()
76 b.put(i, (byte) i); in testByteSwappedBulkGet()
78 b.position(1); in testByteSwappedBulkGet()
81 b.order(ByteOrder.BIG_ENDIAN).asCharBuffer().get(chars, 1, 4); in testByteSwappedBulkGet()
83 b.order(ByteOrder.LITTLE_ENDIAN).asCharBuffer().get(chars, 1, 4); in testByteSwappedBulkGet()
87 b.order(ByteOrder.BIG_ENDIAN).asDoubleBuffer().get(doubles, 1, 1); in testByteSwappedBulkGet()
91 b.order(ByteOrder.LITTLE_ENDIAN).asDoubleBuffer().get(doubles, 1, 1); in testByteSwappedBulkGet()
97 b.order(ByteOrder.BIG_ENDIAN).asFloatBuffer().get(floats, 1, 2); in testByteSwappedBulkGet()
102 b.order(ByteOrder.LITTLE_ENDIAN).asFloatBuffer().get(floats, 1, 2); in testByteSwappedBulkGet()
[all …]
DOldAndroidNIOTest.java34 void checkBuffer(Buffer b) { in checkBuffer() argument
35 assertTrue(0 <= b.position()); in checkBuffer()
36 assertTrue(b.position() <= b.limit()); in checkBuffer()
37 assertTrue(b.limit() <= b.capacity()); in checkBuffer()
71 private void byteBufferTest(ByteBuffer b) { in byteBufferTest() argument
72 checkBuffer(b); in byteBufferTest()
75 b.order(ByteOrder.LITTLE_ENDIAN); in byteBufferTest()
76 ByteBuffer dupe = b.duplicate(); in byteBufferTest()
78 b.order(ByteOrder.BIG_ENDIAN); in byteBufferTest()
82 b.put(-1, (byte) 0); in byteBufferTest()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DStrictMathTest.java37 private void testIntExact(int a, int b) { in testIntExact() argument
38 testAddExactI(a, b); in testIntExact()
39 testSubtractExactI(a, b); in testIntExact()
40 testMultiplyExactI(a, b); in testIntExact()
43 private void testAddExactI(int a, int b) { in testAddExactI() argument
44 long expected = (long) a + (long) b; in testAddExactI()
46 assertEquals(expected, StrictMath.addExact(a, b)); in testAddExactI()
48 if (expected == a + b) { in testAddExactI()
54 private void testSubtractExactI(int a, int b) { in testSubtractExactI() argument
55 long expected = (long) a - (long) b; in testSubtractExactI()
[all …]
DMathTest.java37 private void testIntExact(int a, int b) { in testIntExact() argument
38 testAddExactI(a, b); in testIntExact()
39 testSubtractExactI(a, b); in testIntExact()
40 testMultiplyExactI(a, b); in testIntExact()
46 private void testAddExactI(int a, int b) { in testAddExactI() argument
47 long expected = (long) a + (long) b; in testAddExactI()
49 assertEquals(expected, Math.addExact(a, b)); in testAddExactI()
51 if (expected == a + b) { in testAddExactI()
57 private void testSubtractExactI(int a, int b) { in testSubtractExactI() argument
58 long expected = (long) a - (long) b; in testSubtractExactI()
[all …]
/libcore/ojluni/src/main/java/java/nio/
DBufferMismatch.java34 static int mismatch(ByteBuffer a, int aOff, ByteBuffer b, int bOff, int length) { in mismatch() argument
37 if (a.get(aOff) != b.get(bOff)) in mismatch()
41 b.base(), b.address + bOff, in mismatch()
48 if (a.get(aOff + i) != b.get(bOff + i)) in mismatch()
54 static int mismatch(CharBuffer a, int aOff, CharBuffer b, int bOff, int length) { in mismatch() argument
59 if (length > 3 && a.charRegionOrder() == b.charRegionOrder() in mismatch()
60 && a.charRegionOrder() != null && b.charRegionOrder() != null) { in mismatch()
61 if (a.get(aOff) != b.get(bOff)) in mismatch()
65 b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE), in mismatch()
72 if (a.get(aOff + i) != b.get(bOff + i)) in mismatch()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
DNullCipherTest.java101 byte [] b = {1, 2, 3, 4, 5}; in testUpdatebyteArray()
102 byte [] r = c.update(b); in testUpdatebyteArray()
103 assertEquals("different length", b.length, r.length); in testUpdatebyteArray()
104 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArray()
111 byte [] b = {1, 2, 3, 4, 5}; in testUpdatebyteArrayintint()
112 byte [] r = c.update(b, 0, 5); in testUpdatebyteArrayintint()
113 assertEquals("different length", b.length, r.length); in testUpdatebyteArrayintint()
114 assertTrue("different content", Arrays.equals(b, r)); in testUpdatebyteArrayintint()
116 r = c.update(b, 1, 3); in testUpdatebyteArrayintint()
119 assertEquals("different content", b[i + 1], r[i]); in testUpdatebyteArrayintint()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DLocaleTest.java55 Locale.Builder b = new Locale.Builder(); in test_extension_builder() local
56 Locale localeWithoutExtension = b.build(); in test_extension_builder()
57 b.setExtension('g', "FO_ba-BR_bg"); in test_extension_builder()
58 Locale locale = b.build(); in test_extension_builder()
329 Locale.Builder b = new Locale.Builder(); in test_Builder_setLanguage() local
332 b.setLanguage("EN"); in test_Builder_setLanguage()
333 assertEquals("en", b.build().getLanguage()); in test_Builder_setLanguage()
335 b = new Locale.Builder(); in test_Builder_setLanguage()
339 b.setLanguage("e"); in test_Builder_setLanguage()
348 b.setLanguage("foobarbar"); in test_Builder_setLanguage()
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOldAndroidPrintWriterTest.java48 PrintWriter b = new PrintWriter(ba); in testPrintWriter() local
50 b.print(true); in testPrintWriter()
51 b.print((char) 'A'); in testPrintWriter()
52 b.print("BCD".toCharArray()); in testPrintWriter()
53 b.print((double) 1.2); in testPrintWriter()
54 b.print((float) 3); in testPrintWriter()
55 b.print((int) 4); in testPrintWriter()
56 b.print((long) 5); in testPrintWriter()
58 b.println(); in testPrintWriter()
59 b.println(true); in testPrintWriter()
[all …]
DOldAndroidStreamTokenizerTest.java35 StreamTokenizer b = new StreamTokenizer(ba); in testStreamTokenizer() local
49 b.commentChar('u'); in testStreamTokenizer()
50 b.eolIsSignificant(true); in testStreamTokenizer()
51 b.lowerCaseMode(true); in testStreamTokenizer()
52 b.ordinaryChar('y'); in testStreamTokenizer()
53 b.slashStarComments(true); in testStreamTokenizer()
55 assertEquals(StreamTokenizer.TT_NUMBER, b.nextToken()); in testStreamTokenizer()
56 assertEquals(-3.8, b.nval); in testStreamTokenizer()
57 assertEquals("Token[n=-3.8], line 1", b.toString()); in testStreamTokenizer()
58 assertEquals(39, b.nextToken()); // ' in testStreamTokenizer()
[all …]
/libcore/ojluni/src/main/java/jdk/internal/util/
DArraysSupport.java114 Object b, long bOffset, in vectorizedMismatch() argument
128 long bv = U.getLongUnaligned(b, bOffset + bi); in vectorizedMismatch()
147 int bv = U.getIntUnaligned(b, bOffset + bi); in vectorizedMismatch()
168 boolean[] b, in mismatch() argument
172 if (a[0] != b[0]) in mismatch()
176 b, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET, in mismatch()
183 if (a[i] != b[i]) in mismatch()
190 boolean[] b, int bFromIndex, in mismatch() argument
194 if (a[aFromIndex] != b[bFromIndex]) in mismatch()
200 b, bOffset, in mismatch()
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/
DTestMonthDay.java126 MonthDay b = localDates[j]; in doTest_comparisons_MonthDay() local
128 assertTrue(a.compareTo(b) < 0, a + " <=> " + b); in doTest_comparisons_MonthDay()
129 assertEquals(a.isBefore(b), true, a + " <=> " + b); in doTest_comparisons_MonthDay()
130 assertEquals(a.isAfter(b), false, a + " <=> " + b); in doTest_comparisons_MonthDay()
131 assertEquals(a.equals(b), false, a + " <=> " + b); in doTest_comparisons_MonthDay()
133 assertTrue(a.compareTo(b) > 0, a + " <=> " + b); in doTest_comparisons_MonthDay() local
134 assertEquals(a.isBefore(b), false, a + " <=> " + b); in doTest_comparisons_MonthDay() local
135 assertEquals(a.isAfter(b), true, a + " <=> " + b); in doTest_comparisons_MonthDay() local
136 assertEquals(a.equals(b), false, a + " <=> " + b); in doTest_comparisons_MonthDay() local
138 assertEquals(a.compareTo(b), 0, a + " <=> " + b); in doTest_comparisons_MonthDay() local
[all …]
/libcore/luni/src/test/java/libcore/java/math/
DOldBigDecimalArithmeticTest.java30 BigDecimal a, b, res; in testAddMathContextNonTrivial() local
34 b = new BigDecimal("100000000000000.009"); in testAddMathContextNonTrivial()
38 b.round(mc).toString()); in testAddMathContextNonTrivial()
40 a.round(mc).add(b.round(mc)).toString()); in testAddMathContextNonTrivial()
41 res = a.add(b, mc); in testAddMathContextNonTrivial()
46 b = new BigDecimal("1000000000000000090000000000.0000005"); in testAddMathContextNonTrivial()
47 res = a.add(b, mc); in testAddMathContextNonTrivial()
55 BigDecimal a, b, res; in testSubtractMathContextNonTrivial() local
59 b = new BigDecimal("10000000000000000.9"); in testSubtractMathContextNonTrivial()
61 a.round(mc).subtract(b.round(mc)).toString()); in testSubtractMathContextNonTrivial()
[all …]

12345678910>>...26