Home
last modified time | relevance | path

Searched refs:bytes (Results 1 – 25 of 157) sorted by relevance

1234567

/libcore/ojluni/src/main/native/
DObjectInputStream.c61 jbyte *bytes; in Java_java_io_ObjectInputStream_bytesToFloats() local
73 bytes = (*env)->GetPrimitiveArrayCritical(env, src, NULL); in Java_java_io_ObjectInputStream_bytesToFloats()
74 if (bytes == NULL) /* exception thrown */ in Java_java_io_ObjectInputStream_bytesToFloats()
79 (*env)->ReleasePrimitiveArrayCritical(env, src, bytes, JNI_ABORT); in Java_java_io_ObjectInputStream_bytesToFloats()
85 (*env)->ReleasePrimitiveArrayCritical(env, src, bytes, JNI_ABORT); in Java_java_io_ObjectInputStream_bytesToFloats()
92 ival = ((bytes[srcpos + 0] & 0xFF) << 24) + in Java_java_io_ObjectInputStream_bytesToFloats()
93 ((bytes[srcpos + 1] & 0xFF) << 16) + in Java_java_io_ObjectInputStream_bytesToFloats()
94 ((bytes[srcpos + 2] & 0xFF) << 8) + in Java_java_io_ObjectInputStream_bytesToFloats()
95 ((bytes[srcpos + 3] & 0xFF) << 0); in Java_java_io_ObjectInputStream_bytesToFloats()
101 (*env)->ReleasePrimitiveArrayCritical(env, src, bytes, JNI_ABORT); in Java_java_io_ObjectInputStream_bytesToFloats()
[all …]
DObjectOutputStream.c60 jbyte *bytes; in Java_java_io_ObjectOutputStream_floatsToBytes() local
83 bytes = (*env)->GetPrimitiveArrayCritical(env, dst, NULL); in Java_java_io_ObjectOutputStream_floatsToBytes()
84 if (bytes == NULL) { /* exception thrown */ in Java_java_io_ObjectOutputStream_floatsToBytes()
99 bytes[dstpos++] = (ival >> 24) & 0xFF; in Java_java_io_ObjectOutputStream_floatsToBytes()
100 bytes[dstpos++] = (ival >> 16) & 0xFF; in Java_java_io_ObjectOutputStream_floatsToBytes()
101 bytes[dstpos++] = (ival >> 8) & 0xFF; in Java_java_io_ObjectOutputStream_floatsToBytes()
102 bytes[dstpos++] = (ival >> 0) & 0xFF; in Java_java_io_ObjectOutputStream_floatsToBytes()
106 (*env)->ReleasePrimitiveArrayCritical(env, dst, bytes, 0); in Java_java_io_ObjectOutputStream_floatsToBytes()
132 jbyte *bytes; in Java_java_io_ObjectOutputStream_doublesToBytes() local
155 bytes = (*env)->GetPrimitiveArrayCritical(env, dst, NULL); in Java_java_io_ObjectOutputStream_doublesToBytes()
[all …]
DBits.c56 #define GETCRITICAL(bytes, env, obj) { \ argument
57 bytes = (*env)->GetPrimitiveArrayCritical(env, obj, NULL); \
58 if (bytes == NULL) \
62 #define RELEASECRITICAL(bytes, env, obj, mode) { \ argument
63 (*env)->ReleasePrimitiveArrayCritical(env, obj, bytes, mode); \
79 jbyte *bytes; in Java_java_nio_Bits_copyFromShortArray() local
93 GETCRITICAL(bytes, env, src); in Java_java_nio_Bits_copyFromShortArray()
95 srcShort = (jshort *)(bytes + srcPos); in Java_java_nio_Bits_copyFromShortArray()
102 RELEASECRITICAL(bytes, env, src, JNI_ABORT); in Java_java_nio_Bits_copyFromShortArray()
114 jbyte *bytes; in Java_java_nio_Bits_copyToShortArray() local
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DManifestDigester.java108 public ManifestDigester(byte bytes[]) in ManifestDigester() argument
110 rawBytes = bytes; in ManifestDigester()
131 if (isNameAttr(bytes, start)) { in ManifestDigester()
136 new String(bytes, start+6, len-6, "UTF8")); in ManifestDigester()
140 if (bytes[i] == '\r') { in ManifestDigester()
148 if (bytes[i++] == ' ') { in ManifestDigester()
152 && (bytes[i++] != '\n')); in ManifestDigester()
153 if (bytes[i-1] != '\n') in ManifestDigester()
156 if (bytes[i-2] == '\r') in ManifestDigester()
161 nameBuf.append(new String(bytes, wrapStart, in ManifestDigester()
[all …]
DDerOutputStream.java189 byte[] bytes = new byte[4]; in putIntegerContents()
194 bytes[3] = (byte) (i & 0xff); in putIntegerContents()
195 bytes[2] = (byte)((i & 0xff00) >>> 8); in putIntegerContents()
196 bytes[1] = (byte)((i & 0xff0000) >>> 16); in putIntegerContents()
197 bytes[0] = (byte)((i & 0xff000000) >>> 24); in putIntegerContents()
202 if (bytes[0] == (byte)0xff) { in putIntegerContents()
207 if ((bytes[j] == (byte)0xff) && in putIntegerContents()
208 ((bytes[j+1] & 0x80) == 0x80)) in putIntegerContents()
213 } else if (bytes[0] == 0x00) { in putIntegerContents()
218 if ((bytes[j] == 0x00) && in putIntegerContents()
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DOutputStreamWriterTest.java66 byte[] bytes = baos.toByteArray(); in testFlush()
67 assertEquals(8196, bytes.length); in testFlush()
70 assertEquals((byte) 0, bytes[i++]); in testFlush()
71 assertEquals((byte) 0, bytes[i++]); in testFlush()
72 assertEquals((byte) 0, bytes[i++]); in testFlush()
73 assertEquals((byte) 'x', bytes[i++]); in testFlush()
77 assertEquals((byte) 0x00, bytes[i++]); in testFlush() local
78 assertEquals((byte) 0x02, bytes[i++]); in testFlush() local
79 assertEquals((byte) 0x0b, bytes[i++]); in testFlush() local
80 assertEquals((byte) 0x9f, bytes[i++]); in testFlush() local
[all …]
DDataOutputStreamTest.java26 private ByteArrayOutputStream bytes = new ByteArrayOutputStream(); field in DataOutputStreamTest
27 private DataOutputStream os = new DataOutputStream(bytes);
32 assertEquals("[01, 00]", toHexString(bytes.toByteArray())); in test_writeBoolean()
42 assertEquals("[ff, 00, 01, 81, 34]", toHexString(bytes.toByteArray())); in test_writeByte()
48 assertEquals("[30, 34, 31]", toHexString(bytes.toByteArray())); in test_writeBytes()
55 assertEquals("[00, 30, 12, 34]", toHexString(bytes.toByteArray())); in test_writeChar()
61 assertEquals("[00, 30, 12, 34, 00, 31]", toHexString(bytes.toByteArray())); in test_writeChars()
66 assertEquals("[01, 23, 45, 67, 89, ab, cd, ef]", toHexString(bytes.toByteArray())); in test_writeDouble()
71 assertEquals("[01, 23, 45, 67]", toHexString(bytes.toByteArray())); in test_writeFloat()
76 assertEquals("[01, 23, 45, 67]", toHexString(bytes.toByteArray())); in test_writeInt()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DBitSetTest.java81 private static void assertBitSet(BitSet bs, byte[] bytes, String s) { in assertBitSet() argument
82 for (int i = 0; i < 8 * bytes.length; ++i) { in assertBitSet()
83 assertEquals(bs.toString(), ((bytes[i / 8] & (1L << (i % 8))) != 0), bs.get(i)); in assertBitSet()
86 for (int i = 0; i < bytes.length; ++i) { in assertBitSet()
87 cardinality += Integer.bitCount(((int) bytes[i]) & 0xff); in assertBitSet()
95 assertEquals(roundUp(8 * bytes.length, 64), bs.size()); in assertBitSet()
103 private static void assertBitSet(byte[] bytes, String s) { in assertBitSet() argument
105 assertBitSet(BitSet.valueOf(bytes), bytes, s); in assertBitSet() local
107 assertBitSet(BitSet.valueOf(ByteBuffer.wrap(bytes)), bytes, s); in assertBitSet() local
109 byte[] paddedBytes = new byte[1 + bytes.length + 1]; in assertBitSet()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DMessageDigest1Test.java59 final byte[] bytes = { 1, 2, 3, 4, 5 }; in test_updateLB$LILI()
60 md.update(bytes, 1, 2); in test_updateLB$LILI()
72 md.update(bytes, 0, bytes.length + 1); in test_updateLB$LILI()
78 md.update(bytes, Integer.MAX_VALUE, 1); in test_updateLB$LILI()
88 assertSame("buf", bytes, arg0); in test_updateLB$LILI()
94 md.update(bytes, offset, len); in test_updateLB$LILI()
153 final byte[] bytes = new byte[] { 2, 4, 1 }; in test_digestLB$LILI()
162 md.digest(bytes, 0, bytes.length + 1); in test_digestLB$LILI()
168 md.digest(bytes, Integer.MAX_VALUE, 1); in test_digestLB$LILI()
179 assertSame("buf", bytes, arg0); in test_digestLB$LILI()
[all …]
/libcore/dex/src/main/java/com/android/dex/util/
DByteArrayByteInput.java21 private final byte[] bytes; field in ByteArrayByteInput
24 public ByteArrayByteInput(byte... bytes) { in ByteArrayByteInput() argument
25 this.bytes = bytes; in ByteArrayByteInput()
29 return bytes[position++]; in readByte()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/
DByteBufferTest.java816 byte bytes[] = new byte[2]; in testAsCharBuffer()
825 buf.get(bytes); in testAsCharBuffer()
827 assertEquals(bytes2char(bytes, buf.order()), value); in testAsCharBuffer()
836 buf.get(bytes); in testAsCharBuffer()
838 assertEquals(bytes2char(bytes, buf.order()), value); in testAsCharBuffer()
850 buf.get(bytes); in testAsCharBuffer()
851 assertTrue(Arrays.equals(bytes, char2bytes(value, buf.order()))); in testAsCharBuffer()
862 buf.get(bytes); in testAsCharBuffer()
863 assertTrue(Arrays.equals(bytes, char2bytes(value, buf.order()))); in testAsCharBuffer()
872 byte bytes[] = new byte[8]; in testAsDoubleBuffer()
[all …]
/libcore/benchmarks/src/benchmarks/regression/
DCharsetBenchmark.java42 byte[] bytes = makeBytes(makeString(length)); in time_new_String_BString()
44 new String(bytes, name); in time_new_String_BString()
49 byte[] bytes = makeBytes(makeString(length)); in time_new_String_BII()
51 new String(bytes, 0, bytes.length); in time_new_String_BII()
56 byte[] bytes = makeBytes(makeString(length)); in time_new_String_BIIString()
58 new String(bytes, 0, bytes.length, name); in time_new_String_BIIString()
DChecksumBenchmark.java24 byte[] bytes = new byte[10000]; in timeAdler_block()
27 adler.update(bytes); in timeAdler_block()
37 byte[] bytes = new byte[10000]; in timeCrc_block()
40 crc.update(bytes); in timeCrc_block()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/nio/charset/
DCharsetEncoder2Test.java162 ByteBuffer bytes = ByteBuffer.allocate(4); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB() local
166 CoderResult result = encoder.encode(char1, bytes, false); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
169 assertEquals(4, bytes.remaining()); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
171 result = encoder.encode(char2, bytes, true); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
175 assertEquals(0, bytes.remaining()); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
178 assertEquals(4, bytes.limit()); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
179 assertEquals((byte) 0xf0, bytes.get(0)); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
180 assertEquals((byte) 0x90, bytes.get(1)); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
181 assertEquals((byte) 0x80, bytes.get(2)); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
182 assertEquals((byte) 0x80, bytes.get(3)); in test_EncodeLjava_nio_CharBufferLjava_nio_ByteBufferB()
[all …]
/libcore/ojluni/src/main/java/sun/net/
DTelnetInputStream.java128 public int read(byte bytes[]) throws IOException { in read() argument
129 return read(bytes, 0, bytes.length); in read()
136 public int read(byte bytes[], int off, int length) throws IOException { in read() argument
138 return super.read(bytes, off, length); in read()
147 bytes[off++] = (byte)c; in read()
/libcore/luni/src/test/java/libcore/java/lang/reflect/
DArrayTest.java24 private static byte[] bytes; field in ArrayTest
35 bytes = new byte[] { (byte) 0xff }; in setUp()
46 try { Array.getBoolean(bytes, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetBoolean()
58 assertEquals(bytes[0], Array.getByte(bytes, 0)); in testGetByte()
70 try { Array.getChar(bytes, 0); fail(); } catch (IllegalArgumentException expected) {} in testGetChar()
82 assertEquals((double) bytes[0], Array.getDouble(bytes, 0)); in testGetDouble()
94 assertEquals((float) bytes[0], Array.getFloat(bytes, 0)); in testGetFloat()
106 assertEquals((int) bytes[0], Array.getInt(bytes, 0)); in testGetInt()
118 assertEquals((long) bytes[0], Array.getLong(bytes, 0)); in testGetLong()
130 assertEquals((int) bytes[0], Array.getShort(bytes, 0)); in testGetShort()
[all …]
/libcore/tzdata/update/src/main/libcore/tzdata/update/
DConfigBundle.java47 private final byte[] bytes; field in ConfigBundle
49 public ConfigBundle(byte[] bytes) { in ConfigBundle() argument
50 this.bytes = bytes; in ConfigBundle()
54 return bytes; in getBundleBytes()
58 extractZipSafely(new ByteArrayInputStream(bytes), targetDir, true /* makeWorldReadable */); in extractTo()
116 if (!Arrays.equals(bytes, that.bytes)) { in equals()
/libcore/luni/src/test/java/libcore/io/
DBase64Test.java208 byte[] bytes = asciiToBytes(in); in decodeToString()
209 byte[] out = Base64.decode(bytes); in decodeToString()
216 private static String bytesToAscii(byte[] bytes) { in bytesToAscii() argument
221 ByteBuffer bytesBuffer = ByteBuffer.wrap(bytes); in bytesToAscii()
229 Arrays.toString(bytesToInts(bytes)) + " contains non-ASCII codes"); in bytesToAscii()
242 byte[] bytes = new byte[bytesBuffer.remaining()]; in asciiToBytes()
243 bytesBuffer.get(bytes, 0, bytes.length); in asciiToBytes()
244 return bytes; in asciiToBytes()
254 byte[] bytes = Base64.decode(asciiToBytes(in)); in decodeToInts()
255 return bytesToInts(bytes); in decodeToInts()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DBufferedInputStreamTest.java256 byte[] bytes = new byte[256]; in test_markI()
258 bytes[i] = (byte) i; in test_markI()
261 new ByteArrayInputStream(bytes), 12); in test_markI()
268 in = new BufferedInputStream(new ByteArrayInputStream(bytes), 12); in test_markI()
278 bytes = new byte[3]; in test_markI()
279 int result = buf.read(bytes); in test_markI()
281 assertEquals("Assert 0:", 0, bytes[0]); in test_markI()
282 assertEquals("Assert 1:", 1, bytes[1]); in test_markI()
283 assertEquals("Assert 2:", 2, bytes[2]); in test_markI()
289 bytes = new byte[4]; in test_markI()
[all …]
DFileOutputStreamTest.java36 private byte[] bytes; field in FileOutputStreamTest
41 bytes = new byte[10]; in setUp()
42 for (int i = 0; i < bytes.length; i++) { in setUp()
43 bytes[i] = (byte) i; in setUp()
289 fos.write(bytes); in test_getChannel()
301 fos.write(bytes); in test_getChannel_Append()
303 fos.write(bytes); in test_getChannel_Append()
305 fos.write(bytes); in test_getChannel_Append()
322 fos.write(bytes); in test_getChannel_UnAppend()
324 fos.write(bytes); in test_getChannel_UnAppend()
[all …]
/libcore/luni/src/main/java/libcore/io/
DIoUtils.java196 private byte[] bytes; field in IoUtils.FileReader
227 bytes = new byte[capacity]; in FileReader()
232 int capacity = bytes.length; in readFully()
234 while ((read = Libcore.os.read(fd, bytes, count, capacity - count)) != 0) { in readFully()
242 System.arraycopy(bytes, 0, newBytes, 0, capacity); in readFully()
243 bytes = newBytes; in readFully()
263 if (count == bytes.length) { in toByteArray()
264 return bytes; in toByteArray()
267 System.arraycopy(bytes, 0, result, 0, count); in toByteArray()
272 return new String(bytes, 0, count, cs); in toString()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/zip/
DInflaterOutputStreamTest.java259 byte[] bytes = { 0, 1, 2, 3 }; in test_write_$BII_Illegal()
261 ios.write(bytes, 0, 4); in test_write_$BII_Illegal()
277 ios.write(bytes, 0, 4); in test_write_$BII_Illegal()
283 ios.write(bytes, -1, 4); in test_write_$BII_Illegal()
289 ios.write(bytes, -1, -4); in test_write_$BII_Illegal()
295 ios.write(bytes, 0, 400); in test_write_$BII_Illegal()
333 ios.write(bytes, -1, 4); in test_write_$BII_Illegal()
339 ios.write(bytes, 0, -4); in test_write_$BII_Illegal()
345 ios.write(bytes, 0, 100); in test_write_$BII_Illegal()
351 ios.write(bytes, -100, 100); in test_write_$BII_Illegal()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/security/provider/crypto/
DSHA1PRNG_SecureRandomImpl.java192 private void updateSeed(byte[] bytes) { in updateSeed() argument
197 SHA1Impl.updateHash(seed, bytes, 0, bytes.length - 1); in updateSeed()
199 seedLength += bytes.length; in updateSeed()
281 protected synchronized void engineNextBytes(byte[] bytes) { in engineNextBytes() argument
290 if (bytes == null) { in engineNextBytes()
346 if (bytes.length == 0) { in engineNextBytes()
353 n = (HASHBYTES_TO_USE - nextBIndex) < (bytes.length - nextByteToReturn) ? HASHBYTES_TO_USE in engineNextBytes()
355 : bytes.length - nextByteToReturn; in engineNextBytes()
357 System.arraycopy(nextBytes, nextBIndex, bytes, nextByteToReturn, n); in engineNextBytes()
362 if (nextByteToReturn >= bytes.length) { in engineNextBytes()
[all …]
/libcore/luni/src/test/java/libcore/javax/crypto/
DCipherInputStreamTest.java113 byte[] bytes = readAll(in); in testDecrypt_NullInput_Discarded()
115 Arrays.toString(bytes)); in testDecrypt_NullInput_Discarded()
123 byte[] bytes = readAll(in); in testEncrypt()
124 assertEquals(Arrays.toString(aesCipherText), Arrays.toString(bytes)); in testEncrypt()
135 byte[] bytes = readAll(in); in testEncrypt_RC4()
136 assertEquals(Arrays.toString(rc4CipherText), Arrays.toString(bytes)); in testEncrypt_RC4()
146 byte[] bytes = readAll(in); in testDecrypt()
147 assertEquals(Arrays.toString(plainText.getBytes("UTF-8")), Arrays.toString(bytes)); in testDecrypt()
154 byte[] bytes = readAll(in); in testDecrypt_RC4()
155 assertEquals(Arrays.toString(plainText.getBytes("UTF-8")), Arrays.toString(bytes)); in testDecrypt_RC4()
/libcore/ojluni/src/main/java/sun/security/x509/
DUniqueIdentity.java98 byte[] bytes = id.toByteArray(); in encode()
99 int excessBits = bytes.length*8 - id.length(); in encode()
102 out.putLength(bytes.length + 1); in encode()
105 out.write(bytes); in encode()

1234567