Searched defs:bytes (Results 1 - 25 of 62) sorted by relevance

123

/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/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
H A DSecureRandom.java51 * A seed is an array of bytes used to bootstrap random number generation.
263 * Generates and stores random bytes in the given {@code byte[]} for each
266 * @param bytes
267 * the {@code byte[]} to be filled with random bytes.
270 public synchronized void nextBytes(byte[] bytes) { argument
271 secureRandomSpi.engineNextBytes(bytes);
292 int bytes = (numBits+7)/8;
293 byte[] next = new byte[bytes];
297 for (int i = 0; i < bytes; i++) {
300 ret = ret >>> (bytes*
[all...]
/libcore/luni/src/test/java/libcore/java/util/zip/
H A DDeflaterInputStreamTest.java52 public byte[] inflate(byte[] bytes) throws IOException { argument
53 java.io.InputStream in = new InflaterInputStream(new ByteArrayInputStream(bytes));
H A DGZIPInputStreamTest.java82 // 50 bytes of 0s at the end of the first message.
130 // pseudo-random sequence of bytes and assert that they don't compress
133 byte[] bytes = new byte[3000];
134 r.nextBytes(bytes);
143 gzos.write(bytes, offset, size);
158 assertTrue(Arrays.equals(bytes, unzipped));
164 public static byte[] gunzip(byte[] bytes) throws IOException { argument
165 ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
H A DGZIPOutputStreamTest.java41 public static byte[] gzip(byte[] bytes) throws IOException { argument
44 gzippedOut.write(bytes);
H A DInflaterTest.java39 // Compress the bytes, using the passed-in dictionary (or no dictionary).
42 // Get ready to decompress deflatedBytes back to the original bytes ...
120 private static int adler32(byte[] bytes) { argument
122 adler32.update(bytes);
H A DZipInputStreamTest.java53 public static byte[] unzip(String name, byte[] bytes) throws IOException { argument
54 ZipInputStream in = new ZipInputStream(new ByteArrayInputStream(bytes));
H A DZipOutputStreamTest.java52 public static byte[] zip(String name, byte[] bytes) throws IOException { argument
58 zippedOut.write(bytes);
/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/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/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...]
/libcore/luni/src/test/java/libcore/java/nio/channels/
H A DFileChannelTest.java78 byte[] bytes = new byte[4];
80 buffers[0].get(bytes);
81 assertEquals("abcd", new String(bytes, "US-ASCII"));
83 buffers[1].get(bytes);
84 assertEquals("ABCD", new String(bytes, "US-ASCII"));
218 private static FileChannel createFileContainingBytes(byte[] bytes) throws IOException { argument
222 fc.write(ByteBuffer.wrap(bytes));
225 assertEquals(bytes.length, tmp.length());
228 assertEquals(bytes.length, fc.size());
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
H A DSecureRandomSpiTest.java53 protected void engineNextBytes(byte[] bytes) {} argument
/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;
/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/dex/src/test/java/com/android/dex/
H A DEncodedValueReaderTest.java120 private EncodedValueReader readerOf(int... bytes) { argument
121 byte[] data = new byte[bytes.length];
122 for (int i = 0; i < bytes.length; i++) {
123 data[i] = (byte) bytes[i];
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
H A DConsoleTest.java40 private static final byte[] bytes = "hello world\n".getBytes(); field in class:ConsoleTest
42 private InputStream in = new ByteArrayInputStream(bytes);
/libcore/luni/src/main/java/java/io/
H A DInputStreamReader.java33 * of bytes read from the source stream and converts these into characters as
45 private final ByteBuffer bytes = ByteBuffer.allocate(8192); field in class:InputStreamReader
62 * character converter that is used to decode bytes into characters is
90 bytes.limit(0);
107 bytes.limit(0);
125 bytes.limit(0);
151 * bytes, or null if this writer has been closed. Most callers should probably keep
164 * with the two higher-order bytes set to 0. Returns -1 if the end of the
166 * converting bytes in this reader's buffer or by first filling the buffer
189 * 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 DPipedInputStream.java69 * The size of the default pipe in bytes.
104 * @param pipeSize the size of the buffer in bytes.
121 * @param pipeSize the size of the buffer in bytes.
259 * Reads up to {@code byteCount} bytes from this stream and stores them in the
260 * byte array {@code bytes} starting at {@code byteOffset}. Blocks until at
268 * <p>Returns the number of bytes actually read or -1 if the end of the stream
272 * if {@code byteOffset < 0 || byteCount < 0 || byteOffset + byteCount > bytes.length}.
280 * if {@code bytes} is {@code null}.
282 @Override public synchronized int read(byte[] bytes, int byteOffset, int byteCount) throws IOException { argument
283 Arrays.checkOffsetAndCount(bytes
[all...]
/libcore/luni/src/main/java/java/util/zip/
H A DInflaterOutputStream.java69 * @param bufferSize the length in bytes of the internal buffer
131 * Writes to the decompressing output stream. The {@code bytes} array should contain
141 public void write(byte[] bytes, int offset, int byteCount) throws IOException, ZipException { argument
143 Arrays.checkOffsetAndCount(bytes.length, offset, byteCount);
144 inf.setInput(bytes, offset, byteCount);
/libcore/luni/src/test/java/tests/java/security/
H A DSecureClassLoaderTest.java222 public Class define(String name, byte[] bytes) { argument
223 return defineClass(name, bytes, 0, bytes.length,
/libcore/luni/src/test/java/libcore/java/io/
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/test/java/libcore/java/nio/charset/
H A DCharsetEncoderTest.java40 private void assertReplacementBytesForEncoder(String charset, byte[] bytes) { argument
42 assertEquals(Arrays.toString(bytes), Arrays.toString(result));

Completed in 1116 milliseconds

123