Searched refs:bytes (Results 1 - 25 of 133) sorted by relevance

123456

/libcore/dex/src/main/java/com/android/dex/util/
H A DByteArrayByteInput.java21 private final byte[] bytes; field in class:ByteArrayByteInput
24 public ByteArrayByteInput(byte... bytes) { argument
25 this.bytes = bytes;
29 return bytes[position++];
/libcore/crypto/src/main/java/org/conscrypt/
H A DByteArray.java25 private final byte[] bytes; field in class:ByteArray
28 ByteArray(byte[] bytes) { argument
29 this.bytes = bytes;
30 this.hashCode = Arrays.hashCode(bytes);
42 return Arrays.equals(bytes, lhs.bytes);
H A DOpenSSLRandom.java31 protected void engineNextBytes(byte[] bytes) { argument
32 NativeCrypto.RAND_bytes(bytes);
H A DFinished.java36 * @param bytes
38 public Finished(byte[] bytes) { argument
39 data = bytes;
/libcore/luni/src/main/java/libcore/icu/
H A DCollationKeyICU.java22 private final byte[] bytes; field in class:CollationKeyICU
29 CollationKeyICU(String source, byte[] bytes) { argument
31 this.bytes = bytes;
35 // Get the bytes from the other collation key.
38 rhsBytes = ((CollationKeyICU) other).bytes;
43 if (bytes == null || bytes.length == 0) {
54 int count = Math.min(bytes.length, rhsBytes.length);
56 int s = bytes[
[all...]
/libcore/luni/src/test/java/libcore/java/io/
H A DOutputStreamWriterTest.java66 byte[] bytes = baos.toByteArray();
67 assertEquals(8196, bytes.length);
70 assertEquals((byte) 0, bytes[i++]);
71 assertEquals((byte) 0, bytes[i++]);
72 assertEquals((byte) 0, bytes[i++]);
73 assertEquals((byte) 'x', bytes[i++]);
77 assertEquals((byte) 0x00, bytes[i++]);
78 assertEquals((byte) 0x02, bytes[i++]);
79 assertEquals((byte) 0x0b, bytes[i++]);
80 assertEquals((byte) 0x9f, bytes[
[all...]
H A DDataOutputStreamTest.java26 private ByteArrayOutputStream bytes = new ByteArrayOutputStream(); field in class:DataOutputStreamTest
27 private DataOutputStream os = new DataOutputStream(bytes);
32 assertEquals("[01, 00]", toHexString(bytes.toByteArray()));
42 assertEquals("[ff, 00, 01, 81, 34]", toHexString(bytes.toByteArray()));
48 assertEquals("[30, 34, 31]", toHexString(bytes.toByteArray()));
55 assertEquals("[00, 30, 12, 34]", toHexString(bytes.toByteArray()));
61 assertEquals("[00, 30, 12, 34, 00, 31]", toHexString(bytes.toByteArray()));
66 assertEquals("[01, 23, 45, 67, 89, ab, cd, ef]", toHexString(bytes.toByteArray()));
71 assertEquals("[01, 23, 45, 67]", toHexString(bytes.toByteArray()));
76 assertEquals("[01, 23, 45, 67]", toHexString(bytes
[all...]
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/
H A DBitString.java38 public final byte[] bytes; field in class:BitString
44 * @param bytes array of bytes that represents bit string,
49 public BitString(byte[] bytes, int unusedBits) { argument
55 if (bytes.length == 0 && unusedBits != 0) {
59 this.bytes = bytes;
69 bytes = new byte[size];
78 return (bytes[index] & SET_MASK[offset]) != 0;
85 bytes[inde
[all...]
H A DASN1BitString.java79 byte[] bytes = new byte[in.length - 1];
80 System.arraycopy(in.buffer, in.contentOffset + 1, bytes, 0,
82 return new BitString(bytes, in.buffer[in.contentOffset]);
90 out.length = ((BitString) out.content).bytes.length + 1;
172 byte[] bytes = new byte[index / 8 + 1];
175 index = bytes.length - 1;
179 bytes[i] = (byte) (bytes[i] | SET_MASK[k]);
187 bytes[index] = (byte) (bytes[inde
[all...]
H A DASN1StringType.java47 byte[] bytes = ((String) out.content).getBytes(StandardCharsets.UTF_8);
48 out.content = bytes;
49 out.length = bytes.length;
112 byte[] bytes = ((String) out.content).getBytes(StandardCharsets.UTF_8);
113 out.content = bytes;
114 out.length = bytes.length;
/libcore/luni/src/main/java/java/io/
H A DInputStreamReader.java35 * of bytes read from the source stream and converts these into characters as
47 private final ByteBuffer bytes = ByteBuffer.allocate(8192); field in class:InputStreamReader
64 * character converter that is used to decode bytes into characters is
92 bytes.limit(0);
109 bytes.limit(0);
127 bytes.limit(0);
153 * bytes, or null if this writer has been closed. Most callers should probably keep
166 * with the two higher-order bytes set to 0. Returns -1 if the end of the
168 * converting bytes in this reader's buffer or by first filling the buffer
191 * been reached. The bytes ar
[all...]
H A DOutputStreamWriter.java30 * the target input stream is converted into bytes by either a default or a
33 * of bytes to be written to target stream and converts these into characters as
44 private ByteBuffer bytes = ByteBuffer.allocate(8192); field in class:OutputStreamWriter
52 * the non-null target stream to write converted bytes to.
65 * the target stream to write converted bytes to.
95 * the target stream to write converted bytes to.
113 * the target stream to write converted bytes to.
143 bytes = null;
149 * Flushes this writer. This implementation ensures that all buffered bytes
150 * are written to the target stream. After writing the bytes, th
[all...]
H A DDataOutputStream.java37 * The number of bytes written out so far.
67 * Returns the total number of bytes written to the target stream so far.
69 * @return the number of bytes written to the target stream.
79 * Writes {@code count} bytes from the byte array {@code buffer} starting at
87 * the number of bytes from the {@code buffer} to write.
152 byte[] bytes = new byte[str.length()];
154 bytes[index] = (byte) str.charAt(index);
156 out.write(bytes);
157 written += bytes.length;
165 byte[] bytes
[all...]
/libcore/benchmarks/src/benchmarks/regression/
H A DCharsetBenchmark.java44 byte[] bytes = makeBytes(makeString(length));
46 new String(bytes, name);
51 byte[] bytes = makeBytes(makeString(length));
53 new String(bytes, 0, bytes.length);
58 byte[] bytes = makeBytes(makeString(length));
60 new String(bytes, 0, bytes.length, name);
H A DChecksumBenchmark.java27 byte[] bytes = new byte[10000];
30 adler.update(bytes);
40 byte[] bytes = new byte[10000];
43 crc.update(bytes);
/libcore/support/src/test/java/org/apache/harmony/security/tests/support/
H A DRandomImpl.java40 protected void engineNextBytes(byte[] bytes) { argument
42 for (int i = 0; i < bytes.length; i++) {
43 bytes[i] = (byte)(i + 0xF1);
/libcore/luni/src/main/java/java/security/
H A DSecureRandomSpi.java43 * Generates and stores random bytes in the given {@code byte[]} for each
46 * @param bytes
47 * the {@code byte[]} to be filled with random bytes.
49 protected abstract void engineNextBytes(byte[] bytes); argument
52 * Generates and returns the specified number of seed bytes, computed using
56 * the number of seed bytes.
57 * @return the seed bytes
/libcore/harmony-tests/src/test/java/org/apache/harmony/nio_char/tests/java/nio/charset/
H A DCharsetEncoderTest.java155 * Test reserve bytes encode(CharBuffer,ByteBuffer,boolean)
162 ByteBuffer bytes = ByteBuffer.allocate(4);
166 CoderResult result = encoder.encode(char1, bytes, false);
169 assertEquals(4, bytes.remaining());
171 result = encoder.encode(char2, bytes, true);
175 assertEquals(0, bytes.remaining());
178 assertEquals(4, bytes.limit());
179 assertEquals((byte) 0xf0, bytes.get(0));
180 assertEquals((byte) 0x90, bytes.get(1));
181 assertEquals((byte) 0x80, bytes
[all...]
/libcore/luni/src/main/native/
H A Djava_util_zip_Adler32.cpp27 ScopedByteArrayRO bytes(env, byteArray);
28 if (bytes.get() == NULL) {
31 return adler32(crc, reinterpret_cast<const Bytef*>(bytes.get() + off), len);
H A Djava_util_zip_CRC32.cpp27 ScopedByteArrayRO bytes(env, byteArray);
28 if (bytes.get() == NULL) {
31 jlong result = crc32(crc, reinterpret_cast<const Bytef*>(bytes.get() + off), len);
/libcore/luni/src/test/java/libcore/java/lang/reflect/
H A DArrayTest.java24 private static byte[] bytes; field in class:ArrayTest
35 bytes = new byte[] { (byte) 0xff };
46 try { Array.getBoolean(bytes, 0); fail(); } catch (IllegalArgumentException expected) {}
58 assertEquals(bytes[0], Array.getByte(bytes, 0));
70 try { Array.getChar(bytes, 0); fail(); } catch (IllegalArgumentException expected) {}
82 assertEquals((double) bytes[0], Array.getDouble(bytes, 0));
94 assertEquals((float) bytes[0], Array.getFloat(bytes,
[all...]
/libcore/luni/src/main/java/java/nio/charset/
H A DCharsets.java26 * Returns a new byte array containing the bytes corresponding to the given characters,
32 * Returns a new byte array containing the bytes corresponding to the given characters,
38 * Returns a new byte array containing the bytes corresponding to the given characters,
44 * Returns a new byte array containing the bytes corresponding to the given characters,
60 * Decodes the given US-ASCII bytes into the given char[]. Equivalent to but faster than:
67 public static native void asciiBytesToChars(byte[] bytes, int offset, int length, char[] chars); argument
70 * Decodes the given ISO-8859-1 bytes into the given char[]. Equivalent to but faster than:
76 public static native void isoLatin1BytesToChars(byte[] bytes, int offset, int length, char[] chars); argument
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
H A DMessageDigest1Test.java59 final byte[] bytes = { 1, 2, 3, 4, 5 };
60 md.update(bytes, 1, 2);
72 md.update(bytes, 0, bytes.length + 1);
78 md.update(bytes, Integer.MAX_VALUE, 1);
88 assertSame("buf", bytes, arg0);
94 md.update(bytes, offset, len);
153 final byte[] bytes = new byte[] { 2, 4, 1 };
162 md.digest(bytes, 0, bytes
[all...]
/libcore/luni/src/test/java/libcore/java/util/
H A DBitSetTest.java80 private static void assertBitSet(BitSet bs, byte[] bytes, String s) { argument
81 for (int i = 0; i < 8 * bytes.length; ++i) {
82 assertEquals(bs.toString(), ((bytes[i / 8] & (1L << (i % 8))) != 0), bs.get(i));
85 for (int i = 0; i < bytes.length; ++i) {
86 cardinality += Integer.bitCount(((int) bytes[i]) & 0xff);
94 assertEquals(roundUp(8 * bytes.length, 64), bs.size());
102 private static void assertBitSet(byte[] bytes, String s) { argument
104 assertBitSet(BitSet.valueOf(bytes), bytes, s);
106 assertBitSet(BitSet.valueOf(ByteBuffer.wrap(bytes)), byte
[all...]
/libcore/luni/src/test/java/tests/security/interfaces/
H A DUtil.java99 protected void engineNextBytes(byte[] bytes) { argument
100 java.util.Arrays.fill(bytes, (byte) 0);
101 bytes[bytes.length - 1] = (byte) 10;

Completed in 1038 milliseconds

123456