/libcore/ojluni/src/main/java/java/io/ |
D | Bits.java | 39 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 …]
|
D | OutputStream.java | 62 public abstract void write(int b) throws IOException; in write() argument 74 public void write(byte b[]) throws IOException { in write() argument 75 write(b, 0, b.length); in write() 106 public void write(byte b[], int off, int len) throws IOException { in write() argument 107 if (b == null) { in write() 109 } else if ((off < 0) || (off > b.length) || (len < 0) || in write() 110 ((off + len) > b.length) || ((off + len) < 0)) { in write() 116 write(b[off + i]); in write()
|
/libcore/ojluni/src/main/native/ |
D | zip_util.h | 65 #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 …]
|
D | jlong_md.h | 35 #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/ |
D | BufferTest.java | 128 private void testByteSwappedBulkGet(ByteBuffer b) throws Exception { in testByteSwappedBulkGet() argument 129 for (int i = 0; i < b.limit(); ++i) { in testByteSwappedBulkGet() 130 b.put(i, (byte) i); in testByteSwappedBulkGet() 132 b.position(1); in testByteSwappedBulkGet() 135 b.order(ByteOrder.BIG_ENDIAN).asCharBuffer().get(chars, 1, 4); in testByteSwappedBulkGet() 137 b.order(ByteOrder.LITTLE_ENDIAN).asCharBuffer().get(chars, 1, 4); in testByteSwappedBulkGet() 141 b.order(ByteOrder.BIG_ENDIAN).asDoubleBuffer().get(doubles, 1, 1); in testByteSwappedBulkGet() 145 b.order(ByteOrder.LITTLE_ENDIAN).asDoubleBuffer().get(doubles, 1, 1); in testByteSwappedBulkGet() 151 b.order(ByteOrder.BIG_ENDIAN).asFloatBuffer().get(floats, 1, 2); in testByteSwappedBulkGet() 156 b.order(ByteOrder.LITTLE_ENDIAN).asFloatBuffer().get(floats, 1, 2); in testByteSwappedBulkGet() [all …]
|
D | OldAndroidNIOTest.java | 34 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/ |
D | StrictMathTest.java | 37 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 …]
|
D | MathTest.java | 37 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/libcore/java/math/ |
D | BigIntegerTest.java | 90 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 …]
|
D | OldBigDecimalArithmeticTest.java | 30 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 …]
|
/libcore/luni/src/test/java/libcore/java/util/ |
D | LocaleTest.java | 237 Locale.Builder b = new Locale.Builder(); in test_Builder_setLanguage() local 240 b.setLanguage("EN"); in test_Builder_setLanguage() 241 assertEquals("en", b.build().getLanguage()); in test_Builder_setLanguage() 243 b = new Locale.Builder(); in test_Builder_setLanguage() 247 b.setLanguage("e"); in test_Builder_setLanguage() 256 b.setLanguage("foobarbar"); in test_Builder_setLanguage() 263 b.setLanguage("தமிழ்"); in test_Builder_setLanguage() 269 b = new Locale.Builder(); in test_Builder_setLanguage() 270 b.setLanguage("en"); in test_Builder_setLanguage() 271 b.setLanguage(null); in test_Builder_setLanguage() [all …]
|
/libcore/luni/src/test/java/libcore/java/io/ |
D | OldAndroidPrintWriterTest.java | 48 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 …]
|
D | OldAndroidStreamTokenizerTest.java | 35 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 …]
|
D | OldInputStreamTest.java | 87 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 …]
|
D | OldStreamTokenizerTest.java | 56 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/luni/src/main/java/java/nio/ |
D | NIOAccess.java | 33 public static long getBasePointer(Buffer b) { in getBasePointer() argument 34 long address = b.address; in getBasePointer() 38 return address + (b.position << b._elementSizeShift); in getBasePointer() 45 static Object getBaseArray(Buffer b) { in getBaseArray() argument 46 return b.hasArray() ? b.array() : null; in getBaseArray() 56 static int getBaseArrayOffset(Buffer b) { in getBaseArrayOffset() argument 57 return b.hasArray() ? ((b.arrayOffset() + b.position) << b._elementSizeShift) : 0; in getBaseArrayOffset()
|
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ |
D | NullCipherTest.java | 101 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/ojluni/src/main/java/java/util/zip/ |
D | Inflater.java | 123 public void setInput(byte[] b, int off, int len) { in setInput() argument 124 if (b == null) { in setInput() 127 if (off < 0 || len < 0 || off > b.length - len) { in setInput() 131 this.buf = b; in setInput() 144 public void setInput(byte[] b) { in setInput() argument 145 setInput(b, 0, b.length); in setInput() 159 public void setDictionary(byte[] b, int off, int len) { in setDictionary() argument 160 if (b == null) { in setDictionary() 163 if (off < 0 || len < 0 || off > b.length - len) { in setDictionary() 168 setDictionary(zsRef.address(), b, off, len); in setDictionary() local [all …]
|
D | CRC32.java | 51 public void update(int b) { in update() argument 52 crc = update(crc, b); in update() 58 public void update(byte[] b, int off, int len) { in update() argument 59 if (b == null) { in update() 62 if (off < 0 || len < 0 || off > b.length - len) { in update() 65 crc = updateBytes(crc, b, off, len); in update() 73 public void update(byte[] b) { in update() argument 74 crc = updateBytes(crc, b, 0, b.length); in update() 91 private native static int update(int crc, int b); in update() argument 92 private native static int updateBytes(int crc, byte[] b, int off, int len); in updateBytes() argument
|
D | Adler32.java | 55 public void update(int b) { in update() argument 56 adler = update(adler, b); in update() 62 public void update(byte[] b, int off, int len) { in update() argument 63 if (b == null) { in update() 66 if (off < 0 || len < 0 || off > b.length - len) { in update() 69 adler = updateBytes(adler, b, off, len); in update() 77 public void update(byte[] b) { in update() argument 78 adler = updateBytes(adler, b, 0, b.length); in update() 105 byte[] b = new byte[rem]; in update() 106 buffer.get(b); in update() [all …]
|
D | Deflater.java | 199 public void setInput(byte[] b, int off, int len) { in setInput() argument 200 if (b== null) { in setInput() 203 if (off < 0 || len < 0 || off > b.length - len) { in setInput() 207 this.buf = b; in setInput() 219 public void setInput(byte[] b) { in setInput() argument 220 setInput(b, 0, b.length); in setInput() 235 public void setDictionary(byte[] b, int off, int len) { in setDictionary() argument 236 if (b == null) { in setDictionary() 239 if (off < 0 || len < 0 || off > b.length - len) { in setDictionary() 244 setDictionary(zsRef.address(), b, off, len); in setDictionary() local [all …]
|
/libcore/luni/src/test/java/tests/security/spec/ |
D | EllipticCurveTest.java | 46 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/lang/ |
D | StrictMath.java | 613 public static native double pow(double a, double b); in pow() argument 985 public static int max(int a, int b) { in max() argument 986 return (a >= b) ? a : b; in max() 999 public static long max(long a, long b) { in max() argument 1000 return (a >= b) ? a : b; in max() 1021 public static float max(float a, float b) { in max() argument 1025 (b == 0.0f) && in max() 1028 return b; in max() 1030 return (a >= b) ? a : b; in max() 1047 public static double max(double a, double b) { in max() argument [all …]
|
/libcore/luni/src/test/java/libcore/java/util/jar/ |
D | OldAttributesTest.java | 69 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/luni/src/main/java/org/apache/harmony/security/provider/crypto/ |
D | SHA1Impl.java | 76 int b = arrW[HASH_OFFSET +1]; in computeHash() local 100 ( ( b & c) | ((~b) & d) ) + in computeHash() 104 c = ( b<<30 ) | ( b>>>2 ) ; in computeHash() 105 b = a; in computeHash() 110 temp = ((( a<<5 ) | ( a>>>27 ))) + (b ^ c ^ d) + (e + arrW[t] + 0x6ED9EBA1) ; in computeHash() 113 c = ( b<<30 ) | ( b>>>2 ) ; in computeHash() 114 b = a; in computeHash() 119 temp = (( a<<5 ) | ( a>>>27 )) + ((b & c) | (b & d) | (c & d)) + in computeHash() 123 c = ( b<<30 ) | ( b>>>2 ) ; in computeHash() 124 b = a; in computeHash() [all …]
|