Home
last modified time | relevance | path

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

12345

/libcore/luni/src/main/java/com/ibm/icu4jni/text/
DCollationKey.java20 private final byte[] bytes; field in CollationKey
27 CollationKey(String source, byte[] bytes) { in CollationKey() argument
29 this.bytes = bytes; in CollationKey()
36 rhsBytes = ((CollationKey) other).bytes; in compareTo()
41 if (bytes == null || bytes.length == 0) { in compareTo()
52 int count = Math.min(bytes.length, rhsBytes.length); in compareTo()
54 int s = bytes[i] & 0xff; in compareTo()
63 if (bytes.length < rhsBytes.length) { in compareTo()
66 if (bytes.length > rhsBytes.length) { in compareTo()
101 if (bytes != null && bytes.length != 0) { in hashCode()
[all …]
/libcore/luni/src/main/java/java/lang/
DUnsafeByteSequence.java32 private byte[] bytes; field in UnsafeByteSequence
36 this.bytes = new byte[initialCapacity]; in UnsafeByteSequence()
52 if (count + length >= bytes.length) { in write()
54 System.arraycopy(bytes, 0, newBytes, 0, count); in write()
55 bytes = newBytes; in write()
57 System.arraycopy(buffer, offset, bytes, count, length); in write()
62 if (count == bytes.length) { in write()
64 System.arraycopy(bytes, 0, newBytes, 0, count); in write()
65 bytes = newBytes; in write()
67 bytes[count++] = (byte) b; in write()
[all …]
/libcore/luni/src/main/java/java/nio/
DHeapByteBuffer.java177 int bytes = 0; in loadInt() local
180 bytes = bytes << 8; in loadInt()
181 bytes = bytes | (backingArray[baseOffset + i] & 0xFF); in loadInt()
185 bytes = bytes << 8; in loadInt()
186 bytes = bytes | (backingArray[baseOffset + i] & 0xFF); in loadInt()
189 return bytes; in loadInt()
194 long bytes = 0; in loadLong() local
197 bytes = bytes << 8; in loadLong()
198 bytes = bytes | (backingArray[baseOffset + i] & 0xFF); in loadLong()
202 bytes = bytes << 8; in loadLong()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/
DBitString.java42 public final byte[] bytes; field in BitString
57 public BitString(byte[] bytes, int unusedBits) { in BitString() argument
64 if (bytes.length == 0 && unusedBits != 0) { in BitString()
68 this.bytes = bytes; in BitString()
83 bytes = new byte[size]; in BitString()
92 return (bytes[index] & SET_MASK[offset]) != 0; in getBit()
99 bytes[index] |= SET_MASK[offset]; in setBit()
101 bytes[index] &= RESET_MASK[offset]; in setBit()
106 boolean[] result = new boolean[bytes.length * 8 - unusedBits]; in toBooleanArray()
DASN1BitString.java86 byte[] bytes = new byte[in.length - 1]; in getDecodedObject()
87 System.arraycopy(in.buffer, in.contentOffset + 1, bytes, 0, in getDecodedObject()
89 return new BitString(bytes, in.buffer[in.contentOffset]); in getDecodedObject()
101 out.length = ((BitString) out.content).bytes.length + 1; in setEncodingContent()
208 byte[] bytes = new byte[index / 8 + 1]; in setEncodingContent()
211 index = bytes.length - 1; in setEncodingContent()
215 bytes[i] = (byte) (bytes[i] | SET_MASK[k]); in setEncodingContent()
223 bytes[index] = (byte) (bytes[index] | SET_MASK[k]); in setEncodingContent()
227 out.content = new BitString(bytes, unusedBits); in setEncodingContent()
228 out.length = bytes.length + 1; in setEncodingContent()
DASN1StringType.java70 byte[] bytes = ((String) out.content).getBytes(Charsets.UTF_8);
71 out.content = bytes;
72 out.length = bytes.length;
136 byte[] bytes = ((String) out.content).getBytes(Charsets.UTF_8); in setEncodingContent()
137 out.content = bytes; in setEncodingContent()
138 out.length = bytes.length; in setEncodingContent()
/libcore/luni/src/main/java/java/io/
DInputStreamReader.java47 private final ByteBuffer bytes = ByteBuffer.allocate(8192); field in InputStreamReader
92 bytes.limit(0); in InputStreamReader()
109 bytes.limit(0); in InputStreamReader()
127 bytes.limit(0); in InputStreamReader()
239 boolean needInput = !bytes.hasRemaining(); in read()
253 int to_read = bytes.capacity() - bytes.limit(); in read()
254 int off = bytes.arrayOffset() + bytes.limit(); in read()
255 int was_red = in.read(bytes.array(), off, to_read); in read()
263 bytes.limit(bytes.limit() + was_red); in read()
268 result = decoder.decode(bytes, out, false); in read()
[all …]
DOutputStreamWriter.java44 private ByteBuffer bytes = ByteBuffer.allocate(8192); field in OutputStreamWriter
139 encoder.flush(bytes); in close()
144 bytes = null; in close()
162 if ((position = bytes.position()) > 0) { in flush()
163 bytes.flip(); in flush()
164 out.write(bytes.array(), 0, position); in flush()
165 bytes.clear(); in flush()
230 CoderResult result = encoder.encode(chars, bytes, true); in convert()
237 result = encoder.encode(chars, bytes, true); in convert()
/libcore/luni/src/main/java/org/apache/harmony/nio/internal/
DIOUtil.java46 public static int readInputStreamReader(InputStream in, ByteBuffer bytes, in readInputStreamReader() argument
52 fillBuf(in, bytes, chars, decoder); in readInputStreamReader()
76 InputStream in, ByteBuffer bytes, CharBuffer chars, in readInputStreamReader() argument
86 fillBuf(in, bytes, chars, decoder); in readInputStreamReader()
101 fillBuf(in, bytes, chars, decoder); in readInputStreamReader()
120 private static void fillBuf(InputStream in, ByteBuffer bytes, in fillBuf() argument
125 read = in.read(bytes.array()); in fillBuf()
134 bytes.limit(read); in fillBuf()
136 CoderResult result = decoder.decode(bytes, chars, endOfInput); in fillBuf()
140 bytes.clear(); in fillBuf()
[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/luni/src/main/java/java/net/
DURLEncoder.java62 byte[] bytes = new String(new char[] { ch }).getBytes(); in encode()
63 for (int j = 0; j < bytes.length; j++) { in encode()
65 buf.append(digits.charAt((bytes[j] & 0xf0) >> 4)); in encode()
66 buf.append(digits.charAt(bytes[j] & 0xf)); in encode()
127 byte[] bytes = s.getBytes(enc); in convert()
128 for (int j = 0; j < bytes.length; j++) { in convert()
130 buf.append(digits.charAt((bytes[j] & 0xf0) >> 4)); in convert()
131 buf.append(digits.charAt(bytes[j] & 0xf)); in convert()
DURLConnection.java733 byte[] bytes = new byte[64]; in guessContentTypeFromStream()
734 int length = is.read(bytes); in guessContentTypeFromStream()
746 if ((bytes[0] == (byte) 0xFF) && (bytes[1] == (byte) 0xFE)) { in guessContentTypeFromStream()
751 if ((bytes[0] == (byte) 0xFE) && (bytes[1] == (byte) 0xFF)) { in guessContentTypeFromStream()
757 if ((bytes[0] == (byte) 0xEF) && (bytes[1] == (byte) 0xBB) in guessContentTypeFromStream()
758 && (bytes[2] == (byte) 0xBF)) { in guessContentTypeFromStream()
763 if ((bytes[0] == (byte) 0x00) && (bytes[1] == (byte) 0x00) in guessContentTypeFromStream()
764 && (bytes[2] == (byte) 0xFE) in guessContentTypeFromStream()
765 && (bytes[3] == (byte) 0xFF)) { in guessContentTypeFromStream()
770 if ((bytes[0] == (byte) 0xFF) && (bytes[1] == (byte) 0xFE) in guessContentTypeFromStream()
[all …]
DURIEncoderDecoder.java122 byte[] bytes = new String(new char[] { ch }).getBytes(Charsets.UTF_8); in quoteIllegal()
123 for (int j = 0; j < bytes.length; j++) { in quoteIllegal()
125 buf.append(digits.charAt((bytes[j] & 0xf0) >> 4)); in quoteIllegal()
126 buf.append(digits.charAt(bytes[j] & 0xf)); in quoteIllegal()
153 byte[] bytes = new String(new char[] { ch }).getBytes(Charsets.UTF_8); in encodeOthers()
154 for (int j = 0; j < bytes.length; j++) { in encodeOthers()
156 buf.append(digits.charAt((bytes[j] & 0xf0) >> 4)); in encodeOthers()
157 buf.append(digits.charAt(bytes[j] & 0xf)); in encodeOthers()
/libcore/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/
DByteBufferTest.java1014 byte bytes[] = new byte[2]; in testAsCharBuffer()
1024 buf.get(bytes); in testAsCharBuffer()
1026 assertEquals(bytes2char(bytes, buf.order()), value); in testAsCharBuffer()
1035 buf.get(bytes); in testAsCharBuffer()
1037 assertEquals(bytes2char(bytes, buf.order()), value); in testAsCharBuffer()
1049 buf.get(bytes); in testAsCharBuffer()
1050 assertTrue(Arrays.equals(bytes, char2bytes(value, buf.order()))); in testAsCharBuffer()
1061 buf.get(bytes); in testAsCharBuffer()
1062 assertTrue(Arrays.equals(bytes, char2bytes(value, buf.order()))); in testAsCharBuffer()
1077 byte bytes[] = new byte[8]; in testAsDoubleBuffer()
[all …]
/libcore/luni/src/main/java/org/apache/harmony/security/provider/crypto/
DSHA1PRNG_SecureRandomImpl.java178 private void updateSeed(byte[] bytes) { in updateSeed() argument
183 SHA1Impl.updateHash(seed, bytes, 0, bytes.length - 1); in updateSeed()
185 seedLength += bytes.length; in updateSeed()
268 protected void engineNextBytes(byte[] bytes) { in engineNextBytes() argument
277 if (bytes == null) { in engineNextBytes()
328 if (bytes.length == 0) { in engineNextBytes()
335 n = (HASHBYTES_TO_USE - nextBIndex) < (bytes.length - nextByteToReturn) ? HASHBYTES_TO_USE in engineNextBytes()
337 : bytes.length - nextByteToReturn; in engineNextBytes()
339 System.arraycopy(nextBytes, nextBIndex, bytes, nextByteToReturn, n); in engineNextBytes()
344 if (nextByteToReturn >= bytes.length) { in engineNextBytes()
[all …]
/libcore/support/src/test/java/org/apache/harmony/security/tests/support/
DRandomImpl.java40 protected void engineNextBytes(byte[] bytes) { in engineNextBytes() argument
42 for (int i = 0; i < bytes.length; i++) { in engineNextBytes()
43 bytes[i] = (byte)(i + 0xF1); in engineNextBytes()
/libcore/luni/src/test/java/org/apache/harmony/archive/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/test/java/tests/security/interfaces/
DUtil.java99 protected void engineNextBytes(byte[] bytes) { in engineNextBytes() argument
100 java.util.Arrays.fill(bytes, (byte) 0); in engineNextBytes()
101 bytes[bytes.length - 1] = (byte) 10; in engineNextBytes()
/libcore/luni/src/test/java/libcore/java/util/
DSerializableTester.java75 private Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException { in deserialize() argument
76 ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes)); in deserialize()
82 private String hexEncode(byte[] bytes) { in hexEncode() argument
83 StringBuilder result = new StringBuilder(bytes.length * 2); in hexEncode()
84 for (byte b : bytes) { in hexEncode()
/libcore/luni/src/main/native/
Djava_util_zip_Adler32.cpp27 ScopedByteArrayRO bytes(env, byteArray); in Adler32_updateImpl() local
28 if (bytes.get() == NULL) { in Adler32_updateImpl()
31 return adler32(crc, reinterpret_cast<const Bytef*>(bytes.get() + off), len); in Adler32_updateImpl()
Djava_util_zip_CRC32.cpp27 ScopedByteArrayRO bytes(env, byteArray); in CRC32_updateImpl() local
28 if (bytes.get() == NULL) { in CRC32_updateImpl()
31 jlong result = crc32(crc, reinterpret_cast<const Bytef*>(bytes.get() + off), len); in CRC32_updateImpl()
Djava_nio_charset_Charsets.cpp109 ScopedByteArrayRO bytes(env, javaBytes); in Charsets_asciiBytesToChars() local
110 if (bytes.get() == NULL) { in Charsets_asciiBytesToChars()
118 const jbyte* src = &bytes[offset]; in Charsets_asciiBytesToChars()
128 ScopedByteArrayRO bytes(env, javaBytes); in Charsets_isoLatin1BytesToChars() local
129 if (bytes.get() == NULL) { in Charsets_isoLatin1BytesToChars()
137 const jbyte* src = &bytes[offset]; in Charsets_isoLatin1BytesToChars()
156 ScopedByteArrayRW bytes(env, javaBytes); in charsToBytes() local
157 if (bytes.get() == NULL) { in charsToBytes()
162 jbyte* dst = &bytes[0]; in charsToBytes()
/libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/
DIndexedPKIXParameters.java144 final byte[] bytes; field in IndexedPKIXParameters.Bytes
146 Bytes(byte[] bytes) { in Bytes() argument
147 this.bytes = bytes; in Bytes()
148 this.hash = Arrays.hashCode(bytes); in Bytes()
154 return Arrays.equals(bytes, ((Bytes) o).bytes); in equals()
/libcore/luni/src/main/java/java/security/
DSecureRandom.java290 public synchronized void nextBytes(byte[] bytes) { in nextBytes() argument
291 secureRandomSpi.engineNextBytes(bytes); in nextBytes()
312 int bytes = (numBits+7)/8; in next() local
313 byte[] next = new byte[bytes]; in next()
317 for (int i = 0; i < bytes; i++) { in next()
320 ret = ret >>> (bytes*8 - numBits); in next()
/libcore/luni/src/test/java/libcore/java/util/zip/
DGzipTest.java60 public byte[] gzip(byte[] bytes) throws IOException { in gzip() argument
63 gzippedOut.write(bytes); in gzip()
68 public byte[] gunzip(byte[] bytes) throws IOException { in gunzip() argument
69 InputStream in = new GZIPInputStream(new ByteArrayInputStream(bytes)); in gunzip()

12345