Home
last modified time | relevance | path

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

12345678910>>...12

/aosp14/frameworks/base/core/tests/coretests/src/com/android/internal/util/
H A DHexDumpTest.java44 byte[] bytes = new byte[256]; in testBytesToHexString_allByteValues()
45 for (int i = 0; i < bytes.length; i++) { in testBytesToHexString_allByteValues()
46 bytes[i] = (byte) (i % 256); in testBytesToHexString_allByteValues()
63 byte[] bytes = new byte[length]; in testRoundTrip_fromBytes()
64 deterministicRandom.nextBytes(bytes); in testRoundTrip_fromBytes()
81 byte[] bytes = new byte[32]; in testToHexString_offsetLength()
83 bytes[i] = (byte) i; in testToHexString_offsetLength()
84 bytes[16 + i] = (byte) (16 * i); in testToHexString_offsetLength()
101 byte[] bytes = new byte[32]; in testToHexString_case()
103 bytes[i] = (byte) i; in testToHexString_case()
[all …]
H A DBitUtilsTest.java104 assertEquals(0x00000000, bytesToBEInt(bytes(0, 0, 0, 0))); in testBytesToInt()
105 assertEquals(0xffffffff, bytesToBEInt(bytes(255, 255, 255, 255))); in testBytesToInt()
106 assertEquals(0x0a000001, bytesToBEInt(bytes(10, 0, 0, 1))); in testBytesToInt()
107 assertEquals(0x0a000002, bytesToBEInt(bytes(10, 0, 0, 2))); in testBytesToInt()
108 assertEquals(0x0a001fff, bytesToBEInt(bytes(10, 0, 31, 255))); in testBytesToInt()
109 assertEquals(0xe0000001, bytesToBEInt(bytes(224, 0, 0, 1))); in testBytesToInt()
111 assertEquals(0x00000000, bytesToLEInt(bytes(0, 0, 0, 0))); in testBytesToInt()
112 assertEquals(0x01020304, bytesToLEInt(bytes(4, 3, 2, 1))); in testBytesToInt()
113 assertEquals(0xffff0000, bytesToLEInt(bytes(0, 0, 255, 255))); in testBytesToInt()
180 static byte[] bytes(int b1, int b2, int b3, int b4) { in bytes() method in BitUtilsTest
/aosp14/system/core/storaged/
H A Dstoraged_service.cpp51 rec.second.bytes[READ][FOREGROUND][CHARGER_OFF], in dumpUidRecords()
52 rec.second.bytes[WRITE][FOREGROUND][CHARGER_OFF], in dumpUidRecords()
53 rec.second.bytes[READ][BACKGROUND][CHARGER_OFF], in dumpUidRecords()
55 rec.second.bytes[READ][FOREGROUND][CHARGER_ON], in dumpUidRecords()
56 rec.second.bytes[WRITE][FOREGROUND][CHARGER_ON], in dumpUidRecords()
57 rec.second.bytes[READ][BACKGROUND][CHARGER_ON], in dumpUidRecords()
68 uid_usage.bytes[READ][FOREGROUND][CHARGER_OFF], in dumpUidRecordsDebug()
70 uid_usage.bytes[READ][BACKGROUND][CHARGER_OFF], in dumpUidRecordsDebug()
72 uid_usage.bytes[READ][FOREGROUND][CHARGER_ON], in dumpUidRecordsDebug()
73 uid_usage.bytes[WRITE][FOREGROUND][CHARGER_ON], in dumpUidRecordsDebug()
[all …]
H A Dstoraged_uid_monitor.cpp110 if (bytes[i][j][k]) in is_zero()
280 if (uid_usage.bytes[READ][FOREGROUND][CHARGER_ON] + in dump()
281 uid_usage.bytes[READ][FOREGROUND][CHARGER_OFF] + in dump()
282 uid_usage.bytes[READ][BACKGROUND][CHARGER_ON] + in dump()
283 uid_usage.bytes[READ][BACKGROUND][CHARGER_OFF] + in dump()
284 uid_usage.bytes[WRITE][FOREGROUND][CHARGER_ON] + in dump()
286 uid_usage.bytes[WRITE][BACKGROUND][CHARGER_ON] + in dump()
329 usage.uid_ios.bytes[READ][FOREGROUND][charger_stat_] += in update_curr_io_stats_locked()
331 usage.uid_ios.bytes[READ][BACKGROUND][charger_stat_] += in update_curr_io_stats_locked()
333 usage.uid_ios.bytes[WRITE][FOREGROUND][charger_stat_] += in update_curr_io_stats_locked()
[all …]
/aosp14/frameworks/base/core/java/android/os/incremental/
H A DV4Signature.java276 return 4/*length*/ + (bytes == null ? 0 : bytes.length); in bytesSize()
311 readFully(stream, bytes); in readBytes()
312 return bytes; in readBytes()
327 buffer.get(bytes); in readBytes()
328 return bytes; in readBytes()
332 if (bytes == null) { in writeBytes()
336 writeIntLE(stream, bytes.length); in writeBytes()
337 stream.write(bytes); in writeBytes()
341 if (bytes == null) { in writeBytes()
345 buffer.putInt(bytes.length); in writeBytes()
[all …]
/aosp14/system/core/fastboot/
H A Dudp.cpp61 return (static_cast<uint16_t>(bytes[0]) << 8) | bytes[1]; in ExtractUint16()
234 if (bytes == -1) { in SendData()
237 rx_data += bytes; in SendData()
238 rx_length -= bytes; in SendData()
247 ret += bytes; in SendData()
267 ssize_t bytes = 0; in SendSinglePacketHelper() local
270 if (bytes == -1) { in SendSinglePacketHelper()
334 if (bytes == -1) { in Read()
344 return bytes; in Read()
352 if (bytes == -1) { in Write()
[all …]
/aosp14/frameworks/base/services/core/java/com/android/server/power/
H A DWakeLockLog.java505 if (bytes == null || bytes.length == 0) { in fromBytes()
519 if (bytes.length < 3) { in fromBytes()
531 if (bytes.length < 2) { in fromBytes()
603 if (bytes != null && bytes.length >= sizeNeeded) { in toBytes()
621 if (bytes != null && bytes.length >= sizeNeeded) { in toBytes()
638 if (bytes != null && bytes.length >= sizeNeeded) { in toBytes()
1286 int bytes = 0; in getByteSize() local
1289 bytes += 4; // ownerUid in getByteSize()
1290 bytes += 4; // index in getByteSize()
1291 bytes += 8; // lastUsedTime in getByteSize()
[all …]
/aosp14/frameworks/base/telephony/common/com/google/android/mms/pdu/
H A DQuotedPrintable.java42 public static final byte[] decodeQuotedPrintable(byte[] bytes) { in decodeQuotedPrintable() argument
43 if (bytes == null) { in decodeQuotedPrintable()
47 for (int i = 0; i < bytes.length; i++) { in decodeQuotedPrintable()
48 int b = bytes[i]; in decodeQuotedPrintable()
51 if('\r' == (char)bytes[i + 1] && in decodeQuotedPrintable()
52 '\n' == (char)bytes[i + 2]) { in decodeQuotedPrintable()
56 int u = Character.digit((char) bytes[++i], 16); in decodeQuotedPrintable()
57 int l = Character.digit((char) bytes[++i], 16); in decodeQuotedPrintable()
/aosp14/system/core/fs_mgr/libfs_avb/tests/
H A Dutil_test.cpp108 uint8_t bytes[16]; in TEST() local
110 EXPECT_TRUE(HexToBytes((uint8_t*)bytes, sizeof(bytes), hex)); in TEST()
111 for (size_t i = 0; i < sizeof(bytes); i++) { in TEST()
112 EXPECT_EQ(i, bytes[i]); in TEST()
118 uint8_t bytes[16]; in TEST() local
120 EXPECT_TRUE(HexToBytes((uint8_t*)bytes, sizeof(bytes), hex)); in TEST()
122 EXPECT_EQ(16 + i, bytes[i]); in TEST()
141 uint8_t bytes[16]; in TEST() local
143 EXPECT_FALSE(HexToBytes((uint8_t*)bytes, sizeof(bytes), hex)); in TEST()
148 uint8_t bytes[8]; in TEST() local
[all …]
/aosp14/frameworks/base/core/java/com/android/internal/util/
H A DCharSequences.java32 public static CharSequence forAsciiBytes(final byte[] bytes) { in forAsciiBytes() argument
35 return (char) bytes[index]; in forAsciiBytes()
39 return bytes.length; in forAsciiBytes()
43 return forAsciiBytes(bytes, start, end); in forAsciiBytes()
47 return new String(bytes); in forAsciiBytes()
63 public static CharSequence forAsciiBytes(final byte[] bytes,
65 validate(start, end, bytes.length);
68 return (char) bytes[index + start];
79 return forAsciiBytes(bytes, newStart, newEnd);
83 return new String(bytes, start, length());
H A DBitUtils.java103 public static int bytesToBEInt(byte[] bytes) { in bytesToBEInt() argument
104 return (uint8(bytes[0]) << 24) in bytesToBEInt()
105 + (uint8(bytes[1]) << 16) in bytesToBEInt()
106 + (uint8(bytes[2]) << 8) in bytesToBEInt()
107 + (uint8(bytes[3])); in bytesToBEInt()
110 public static int bytesToLEInt(byte[] bytes) { in bytesToLEInt() argument
111 return Integer.reverseBytes(bytesToBEInt(bytes)); in bytesToLEInt()
126 public static void put(ByteBuffer buffer, int position, byte[] bytes) { in put() argument
129 buffer.put(bytes); in put()
/aosp14/system/core/libutils/
H A DJenkinsHash.cpp37 uint32_t JenkinsHashMixBytes(uint32_t hash, const uint8_t* bytes, size_t size) { in JenkinsHashMixBytes() argument
44 uint32_t data = bytes[i] | (bytes[i+1] << 8) | (bytes[i+2] << 16) | (bytes[i+3] << 24); in JenkinsHashMixBytes()
48 uint32_t data = bytes[i]; in JenkinsHashMixBytes()
49 data |= ((size & 3) > 1) ? (bytes[i+1] << 8) : 0; in JenkinsHashMixBytes()
50 data |= ((size & 3) > 2) ? (bytes[i+2] << 16) : 0; in JenkinsHashMixBytes()
/aosp14/frameworks/base/services/core/java/com/android/server/integrity/parser/
H A DRandomAccessObject.java34 public abstract int read(byte[] bytes, int off, int len) throws IOException; in read() argument
48 public static RandomAccessObject ofBytes(byte[] bytes) { in ofBytes() argument
49 return new RandomAccessByteArrayObject(bytes); in ofBytes()
78 public int read(byte[] bytes, int off, int len) throws IOException { in read() argument
79 return mRandomAccessFile.read(bytes, off, len); in read()
97 RandomAccessByteArrayObject(byte[] bytes) { in RandomAccessByteArrayObject() argument
98 mBytes = ByteBuffer.wrap(bytes); in RandomAccessByteArrayObject()
116 public int read(byte[] bytes, int off, int len) throws IOException { in read() argument
121 mBytes.get(bytes, off, len); in read()
/aosp14/frameworks/base/apct-tests/perftests/core/src/android/libcore/regression/
H A DCharsetPerfTest.java92 byte[] bytes = makeBytes(makeString(length)); in time_new_String_BString()
95 new String(bytes, name); in time_new_String_BString()
102 byte[] bytes = makeBytes(makeString(length)); in time_new_String_BII()
105 new String(bytes, 0, bytes.length); in time_new_String_BII()
112 byte[] bytes = makeBytes(makeString(length)); in time_new_String_BIIString()
115 new String(bytes, 0, bytes.length, name); in time_new_String_BIIString()
/aosp14/system/core/debuggerd/libdebuggerd/
H A Dutility.cpp150 if (bytes % sizeof(uintptr_t) != 0) { in dump_memory()
153 bytes &= ~(sizeof(uintptr_t) - 1); in dump_memory()
157 if (bytes == 0) { in dump_memory()
169 if (bytes < len && !skip_2nd_read) { in dump_memory()
176 size_t bytes2 = memory->Read(*addr + bytes, static_cast<uint8_t*>(out) + bytes, len - bytes); in dump_memory()
177 bytes += bytes2; in dump_memory()
178 if (bytes2 > 0 && bytes % sizeof(uintptr_t) != 0) { in dump_memory()
181 bytes &= ~(sizeof(uintptr_t) - 1); in dump_memory()
187 if (bytes == 0) { in dump_memory()
200 return bytes; in dump_memory()
[all …]
/aosp14/frameworks/base/services/core/jni/gnss/
H A DGnssPsds.cpp45 jbyte* bytes = reinterpret_cast<jbyte*>(env->GetPrimitiveArrayCritical(data, 0)); in injectPsdsData() local
47 std::vector<uint8_t>((const uint8_t*)bytes, in injectPsdsData()
48 (const uint8_t*)bytes + length)); in injectPsdsData()
50 env->ReleasePrimitiveArrayCritical(data, bytes, JNI_ABORT); in injectPsdsData()
67 jbyte* bytes = reinterpret_cast<jbyte*>(env->GetPrimitiveArrayCritical(data, 0)); in injectPsdsData() local
68 auto result = mIGnssXtra->injectXtraData(std::string((const char*)bytes, length)); in injectPsdsData()
70 env->ReleasePrimitiveArrayCritical(data, bytes, JNI_ABORT); in injectPsdsData()
/aosp14/frameworks/base/core/tests/utiltests/src/com/android/internal/util/
H A DCharSequencesTest.java30 byte[] bytes = s.getBytes(); in testCharSequences()
32 String copy = toString(forAsciiBytes(bytes)); in testCharSequences()
35 copy = toString(forAsciiBytes(bytes, 0, s.length())); in testCharSequences()
38 String hello = toString(forAsciiBytes(bytes, 0, 5)); in testCharSequences()
41 String l = toString(forAsciiBytes(bytes, 0, 3).subSequence(2, 3)); in testCharSequences()
44 String empty = toString(forAsciiBytes(bytes, 0, 3).subSequence(3, 3)); in testCharSequences()
/aosp14/frameworks/base/core/java/android/util/
H A DBase64InputStream.java103 long bytes = Math.min(n, outputEnd-outputStart); in skip() local
104 outputStart += bytes; in skip()
105 return bytes; in skip()
126 int bytes = Math.min(len, outputEnd-outputStart); in read() local
127 System.arraycopy(coder.output, outputStart, b, off, bytes); in read()
128 outputStart += bytes; in read()
129 return bytes; in read()
H A DEventLog.java242 byte[] bytes; in encodeObject()
244 bytes = string.getBytes("UTF-8"); in encodeObject()
246 bytes = new byte[0]; in encodeObject()
251 .putInt(bytes.length) in encodeObject()
252 .put(bytes) in encodeObject()
259 byte[][] bytes = new byte[objects.length][]; in encodeObject()
262 bytes[i] = encodeObject(objects[i]); in encodeObject()
263 totalLength += bytes[i].length; in encodeObject()
270 buffer.put(bytes[i]); in encodeObject()
285 byte[] bytes = mBuffer.array(); in getBytes()
[all …]
/aosp14/frameworks/base/tests/Camera2Tests/SmartCamera/SimpleCamera/src/androidx/media/filterfw/decoder/
H A DAudioSample.java23 public final byte[] bytes; field in AudioSample
25 public AudioSample(int sampleRate, int channelCount, byte[] bytes) { in AudioSample() argument
28 this.bytes = bytes; in AudioSample()
/aosp14/system/core/fs_mgr/libfs_avb/
H A Dutil.cpp52 bool HexToBytes(uint8_t* bytes, size_t bytes_len, const std::string& hex) { in HexToBytes() argument
53 CHECK(bytes != nullptr); in HexToBytes()
70 bytes[j] = (high << 4) | low; in HexToBytes()
75 std::string BytesToHex(const uint8_t* bytes, size_t bytes_len) { in BytesToHex() argument
76 CHECK(bytes != nullptr); in BytesToHex()
82 hex.push_back(hex_digits[(bytes[i] & 0xF0) >> 4]); in BytesToHex()
83 hex.push_back(hex_digits[bytes[i] & 0x0F]); in BytesToHex()
/aosp14/system/core/storaged/tests/
H A Dstoraged_test.cpp466 .uid_ios.bytes[WRITE][FOREGROUND][CHARGER_ON] = 1000, in TEST()
471 .uid_ios.bytes[READ][FOREGROUND][CHARGER_OFF] = 1000, in TEST()
476 .uid_ios.bytes[WRITE][FOREGROUND][CHARGER_ON] = 1000, in TEST()
477 .uid_ios.bytes[READ][FOREGROUND][CHARGER_ON] = 1000, in TEST()
488 .uid_ios.bytes[WRITE][FOREGROUND][CHARGER_OFF] = 1000, in TEST()
493 .uid_ios.bytes[READ][BACKGROUND][CHARGER_OFF] = 1000, in TEST()
550 .uid_ios.bytes[WRITE][FOREGROUND][CHARGER_ON] = 1000, in TEST()
561 .uid_ios.bytes[WRITE][FOREGROUND][CHARGER_ON] = 1000, in TEST()
654 .uid_ios.bytes[WRITE][FOREGROUND][CHARGER_ON] = 1000, in TEST()
659 .uid_ios.bytes[READ][FOREGROUND][CHARGER_OFF] = 2000, in TEST()
[all …]
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/powerstats/
H A DPowerStatsServiceTest.java438 byte[] bytes = new byte[100]; in testCorruptOnDeviceMeterStorage()
439 rd.nextBytes(bytes); in testCorruptOnDeviceMeterStorage()
481 byte[] bytes = new byte[100]; in testCorruptOnDeviceModelStorage()
482 rd.nextBytes(bytes); in testCorruptOnDeviceModelStorage()
522 byte[] bytes = new byte[100]; in testCorruptOnDeviceResidencyStorage()
523 rd.nextBytes(bytes); in testCorruptOnDeviceResidencyStorage()
714 rd.nextBytes(bytes); in testDataStorageDeletedMeterMismatch()
793 bytes = new byte[100]; in testDataStorageDeletedModelMismatch()
794 rd.nextBytes(bytes); in testDataStorageDeletedModelMismatch()
873 bytes = new byte[100]; in testDataStorageDeletedResidencyMismatch()
[all …]
/aosp14/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/
H A DPulledStatsTest.java57 ByteArrayOutputStream bytes = new ByteArrayOutputStream(); in testPulledStats_UnknownReport() local
58 final ProtoOutputStream proto = new ProtoOutputStream(bytes); in testPulledStats_UnknownReport()
63 assertEquals(0L, bytes.size()); in testPulledStats_UnknownReport()
77 ByteArrayOutputStream bytes = new ByteArrayOutputStream(); in testPulledStats_RemoteViewReportPackages() local
78 final ProtoOutputStream protoStream = new ProtoOutputStream(bytes); in testPulledStats_RemoteViewReportPackages()
84 NotificationRemoteViewsProto.parseFrom(bytes.toByteArray()); in testPulledStats_RemoteViewReportPackages()
/aosp14/system/core/debuggerd/libdebuggerd/test/
H A Ddump_memory_test.cpp101 bytes = std::min(bytes, bytes_partial_read_); in Read()
102 bytes_partial_read_ -= bytes; in Read()
104 } else if (bytes > bytes_available) { in Read()
105 bytes = bytes_available; in Read()
108 if (bytes > 0) { in Read()
113 return bytes; in Read()
117 buffer_.resize(bytes); in SetReadData()
118 memcpy(buffer_.data(), buffer, bytes); in SetReadData()
123 void SetPartialReadAmount(size_t bytes) { in SetPartialReadAmount() argument
124 if (bytes > buffer_.size()) { in SetPartialReadAmount()
[all …]

12345678910>>...12