Home
last modified time | relevance | path

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

12345678910>>...22

/libcore/ojluni/src/main/native/
Dzip_util.h65 #define CH(b, n) (((unsigned char *)(b))[n]) argument
66 #define SH(b, n) (CH(b, n) | (CH(b, n+1) << 8)) argument
67 #define LG(b, n) ((SH(b, n) | (SH(b, n+2) << 16)) &0xffffffffUL) argument
68 #define LL(b, n) (((jlong)LG(b, n)) | (((jlong)LG(b, n+4)) << 32)) argument
69 #define GETSIG(b) LG(b, 0) argument
74 #define LOCVER(b) SH(b, 4) /* version needed to extract */ argument
75 #define LOCFLG(b) SH(b, 6) /* general purpose bit flags */ argument
76 #define LOCHOW(b) SH(b, 8) /* compression method */ argument
77 #define LOCTIM(b) LG(b, 10) /* modification time */ argument
78 #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/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/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/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 …]
DOldInputStreamTest.java87 byte[] b = new byte[10]; in test_read$B()
95 is.read(b), 10); in test_read$B()
98 equal &= (b[i] == ref[i]); in test_read$B()
104 b = new byte[ref.length]; in test_read$B()
105 bytesRead = is.read(b); in test_read$B()
110 equal &= (b[i] == ref[i + 10]); in test_read$B()
116 bytesRead = is.read(b); in test_read$B()
121 byte[] b = new byte[10]; in test_read$BII_Exception()
126 bytesRead = is.read(b, -1, 5); in test_read$BII_Exception()
134 bytesRead = is.read(b, 5, -1); in test_read$BII_Exception()
[all …]
DOldStreamTokenizerTest.java56 StreamTokenizer b = new StreamTokenizer(ba); in test_basicStringTokenizerMethods() local
70 b.commentChar('u'); in test_basicStringTokenizerMethods()
71 b.eolIsSignificant(true); in test_basicStringTokenizerMethods()
72 b.lowerCaseMode(true); in test_basicStringTokenizerMethods()
73 b.ordinaryChar('y'); in test_basicStringTokenizerMethods()
74 b.slashStarComments(true); in test_basicStringTokenizerMethods()
76 Assert.assertTrue(b.nextToken() == StreamTokenizer.TT_NUMBER); in test_basicStringTokenizerMethods()
77 Assert.assertTrue(b.nval == -3.8); in test_basicStringTokenizerMethods()
78 Assert.assertTrue(b.toString().equals("Token[n=-3.8], line 1")); in test_basicStringTokenizerMethods()
79 Assert.assertTrue(b.nextToken() == 39); // ' in test_basicStringTokenizerMethods()
[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 …]
DBigIntegerTest.java90 BigInteger b; in test_Constructor_ILjava_util_Random() local
92 b = new BigInteger(128, rand); in test_Constructor_ILjava_util_Random()
93 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 128); in test_Constructor_ILjava_util_Random()
95 b = new BigInteger(16, rand); in test_Constructor_ILjava_util_Random()
96 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 16); in test_Constructor_ILjava_util_Random()
98 b = new BigInteger(5, rand); in test_Constructor_ILjava_util_Random()
99 assertTrue(b.toString() + " " + b.bitLength(), b.bitLength() <= 5); in test_Constructor_ILjava_util_Random()
105 BigInteger b; in test_Constructor_IILjava_util_Random() local
107 b = new BigInteger(128, 100, rand); in test_Constructor_IILjava_util_Random()
108 assertEquals(b.toString(), 128, b.bitLength()); in test_Constructor_IILjava_util_Random()
[all …]
/libcore/luni/src/test/java/tests/security/spec/
DEllipticCurveTest.java46 BigInteger b = BigInteger.valueOf(19L); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01() local
49 new EllipticCurve(f, a, b, seed); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01()
54 b = BigInteger.valueOf(23L); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01()
56 new EllipticCurve(f1, a, b, seed); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01()
62 b = BigInteger.valueOf(19L); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01()
65 new EllipticCurve(f, a, b, seed); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01()
80 BigInteger b = BigInteger.valueOf(19L); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray02() local
85 new EllipticCurve(f, a, b, seed); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray02()
92 b = BigInteger.valueOf(19L); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray02()
96 new EllipticCurve(f, a, b, seed); in testEllipticCurveECFieldBigIntegerBigIntegerbyteArray02()
[all …]
/libcore/ojluni/src/main/java/java/util/zip/
DInflater.java141 public void setInput(byte[] b, int off, int len) { in setInput() argument
142 if (b == null) { in setInput()
145 if (off < 0 || len < 0 || off > b.length - len) { in setInput()
149 this.buf = b; in setInput()
162 public void setInput(byte[] b) { in setInput() argument
163 setInput(b, 0, b.length); in setInput()
177 public void setDictionary(byte[] b, int off, int len) { in setDictionary() argument
178 if (b == null) { in setDictionary()
181 if (off < 0 || len < 0 || off > b.length - len) { in setDictionary()
186 setDictionary(zsRef.address(), b, off, len); in setDictionary() local
[all …]
DDeflater.java217 public void setInput(byte[] b, int off, int len) { in setInput() argument
218 if (b== null) { in setInput()
221 if (off < 0 || len < 0 || off > b.length - len) { in setInput()
225 this.buf = b; in setInput()
237 public void setInput(byte[] b) { in setInput() argument
238 setInput(b, 0, b.length); in setInput()
253 public void setDictionary(byte[] b, int off, int len) { in setDictionary() argument
254 if (b == null) { in setDictionary()
257 if (off < 0 || len < 0 || off > b.length - len) { in setDictionary()
262 setDictionary(zsRef.address(), b, off, len); in setDictionary() local
[all …]
DAdler32.java59 public void update(int b) { in update() argument
60 adler = update(adler, b); in update()
71 public void update(byte[] b, int off, int len) { in update() argument
72 if (b == null) { in update()
75 if (off < 0 || len < 0 || off > b.length - len) { in update()
78 adler = updateBytes(adler, b, off, len); in update()
86 public void update(byte[] b) { in update() argument
87 adler = updateBytes(adler, b, 0, b.length); in update()
116 byte[] b = new byte[rem]; in update()
117 buffer.get(b); in update()
[all …]
DCRC32.java57 public void update(int b) { in update() argument
58 crc = update(crc, b); in update()
69 public void update(byte[] b, int off, int len) { in update() argument
70 if (b == null) { in update()
73 if (off < 0 || len < 0 || off > b.length - len) { in update()
76 crc = updateBytes(crc, b, off, len); in update()
84 public void update(byte[] b) { in update() argument
85 crc = updateBytes(crc, b, 0, b.length); in update()
113 byte[] b = new byte[rem]; in update()
114 buffer.get(b); in update()
[all …]
/libcore/luni/src/main/java/java/nio/
DNIOAccess.java45 public static long getBasePointer(Buffer b) { in getBasePointer() argument
46 long address = b.address; in getBasePointer()
50 return address + (b.position << b._elementSizeShift); in getBasePointer()
65 public static Object getBaseArray(Buffer b) { in getBaseArray() argument
66 return b.hasArray() ? b.array() : null; in getBaseArray()
84 public static int getBaseArrayOffset(Buffer b) { in getBaseArrayOffset() argument
85 return b.hasArray() ? ((b.arrayOffset() + b.position) << b._elementSizeShift) : 0; in getBaseArrayOffset()
/libcore/luni/src/test/java/libcore/java/util/jar/
DOldAttributesTest.java69 Attributes b = (Attributes) a.clone(); in test_hashCode() local
70 b.putValue("33", "Thirty three"); in test_hashCode()
71 assertNotSame(a.hashCode(), b.hashCode()); in test_hashCode()
72 b = (Attributes) a.clone(); in test_hashCode()
73 b.clear(); in test_hashCode()
74 assertNotSame(a.hashCode(), b.hashCode()); in test_hashCode()
78 Attributes b = new Attributes(); in test_putValueLjava_lang_StringLjava_lang_String() local
79 b.put(new Attributes.Name("1"), "one"); in test_putValueLjava_lang_StringLjava_lang_String()
80 b.putValue("2", "two"); in test_putValueLjava_lang_StringLjava_lang_String()
81 b.put(new Attributes.Name("3"), "three"); in test_putValueLjava_lang_StringLjava_lang_String()
[all …]
/libcore/ojluni/src/test/java/util/stream/bootlib/java/util/stream/
DLongStreamTestScenario.java48 void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) { in STREAM_FOR_EACH_WITH_CLOSE() argument
53 s.forEach(b); in STREAM_FOR_EACH_WITH_CLOSE()
60 void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) { in STREAM_TO_ARRAY() argument
62 b.accept(t); in STREAM_TO_ARRAY()
69 void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) { in STREAM_ITERATOR() argument
71 b.accept(seqIter.nextLong()); in STREAM_ITERATOR()
78 void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) { in STREAM_SPLITERATOR() argument
79 … for (Spliterator.OfLong spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
87 void _run(TestData<T, S_IN> data, LongConsumer b, Function<S_IN, LongStream> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT() argument
88 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
[all …]
/libcore/ojluni/src/test/java/util/stream/testlib/org/openjdk/testlib/java/util/stream/
DDoubleStreamTestScenario.java52 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_FOR_EACH_WITH_CLOSE() argument
57 s.forEach(b); in STREAM_FOR_EACH_WITH_CLOSE()
64 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_TO_ARRAY() argument
66 b.accept(t); in STREAM_TO_ARRAY()
73 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_ITERATOR() argument
75 b.accept(seqIter.nextDouble()); in STREAM_ITERATOR()
82 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR() argument
83 … for (Spliterator.OfDouble spl = m.apply(data.stream()).spliterator(); spl.tryAdvance(b); ) { in STREAM_SPLITERATOR()
91 void _run(TestData<T, S_IN> data, DoubleConsumer b, Function<S_IN, DoubleStream> m) { in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT() argument
92 SpliteratorTestHelper.mixedTraverseAndSplit(b, m.apply(data.stream()).spliterator()); in STREAM_SPLITERATOR_WITH_MIXED_TRAVERSE_AND_SPLIT()
[all …]

12345678910>>...22