Home
last modified time | relevance | path

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

12345

/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/zip/utils/
DLittleEndianUtils.java46 public static long readUnsigned4Le(@Nonnull ByteBuffer bytes) throws IOException { in readUnsigned4Le() argument
47 Preconditions.checkNotNull(bytes, "bytes == null"); in readUnsigned4Le()
49 if (bytes.remaining() < 4) { in readUnsigned4Le()
50 throw new EOFException("Not enough data: 4 bytes expected, " + bytes.remaining() in readUnsigned4Le()
54 byte b0 = bytes.get(); in readUnsigned4Le()
55 byte b1 = bytes.get(); in readUnsigned4Le()
56 byte b2 = bytes.get(); in readUnsigned4Le()
57 byte b3 = bytes.get(); in readUnsigned4Le()
72 public static int readUnsigned2Le(@Nonnull ByteBuffer bytes) throws IOException { in readUnsigned2Le() argument
73 Preconditions.checkNotNull(bytes, "bytes == null"); in readUnsigned2Le()
[all …]
/tools/netsim/rust/daemon/src/bluetooth/
Dadvertise_data.rs41 bytes: Vec<u8>, field
75 self.bytes.clone() in to_bytes()
114 bytes: self.serialize()?, in build()
137 let mut bytes = Vec::new(); in serialize() localVariable
149 bytes.extend(vec![ in serialize()
155 bytes.extend_from_slice(device_name); in serialize()
159 bytes.extend(vec![2, AD_TYPE_TX_POWER, self.tx_power_level.dbm as u8]); in serialize()
175 bytes.extend(vec![ in serialize()
181 bytes.extend_from_slice(manufacturer_data); in serialize()
184 if bytes.len() > MAX_ADV_NONCONN_DATA_LEN { in serialize()
[all …]
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/zip/
DZipField.java146 void skip(@Nonnull ByteBuffer bytes) throws IOException { in skip() argument
147 if (bytes.remaining() < size) { in skip()
149 + bytes.remaining() + " remain in the buffer."); in skip()
152 bytes.position(bytes.position() + size); in skip()
163 long read(@Nonnull ByteBuffer bytes) throws IOException { in read() argument
164 if (bytes.remaining() < size) { in read()
166 + bytes.remaining() + " remain in the buffer."); in read()
169 bytes.order(ByteOrder.LITTLE_ENDIAN); in read()
173 r = LittleEndianUtils.readUnsigned2Le(bytes); in read()
175 r = LittleEndianUtils.readUnsigned4Le(bytes); in read()
[all …]
DCentralDirectory.java224 static CentralDirectory makeFromData(@Nonnull ByteBuffer bytes, int count, @Nonnull ZFile file) in makeFromData() argument
226 Preconditions.checkNotNull(bytes, "bytes == null"); in makeFromData()
233 directory.readEntry(bytes); in makeFromData()
240 + bytes.position() in makeFromData()
281 private void readEntry(@Nonnull ByteBuffer bytes) throws IOException { in readEntry() argument
282 F_SIGNATURE.verify(bytes); in readEntry()
283 long madeBy = F_MADE_BY.read(bytes); in readEntry()
285 long versionNeededToExtract = F_VERSION_EXTRACT.read(bytes); in readEntry()
291 long gpBit = F_GP_BIT.read(bytes); in readEntry()
294 long methodCode = F_METHOD.read(bytes); in readEntry()
[all …]
DEocd.java124 Eocd(@Nonnull ByteBuffer bytes) throws IOException { in Eocd() argument
129 F_SIGNATURE.verify(bytes); in Eocd()
130 F_NUMBER_OF_DISK.verify(bytes); in Eocd()
131 F_DISK_CD_START.verify(bytes); in Eocd()
132 long totalRecords1 = F_RECORDS_DISK.read(bytes); in Eocd()
133 long totalRecords2 = F_RECORDS_TOTAL.read(bytes); in Eocd()
134 long directorySize = F_CD_SIZE.read(bytes); in Eocd()
135 long directoryOffset = F_CD_OFFSET.read(bytes); in Eocd()
136 int commentSize = Ints.checkedCast(F_COMMENT_SIZE.read(bytes)); in Eocd()
152 if (bytes.remaining() < commentSize) { in Eocd()
[all …]
DEncodeUtils.java50 public static String decode(@Nonnull ByteBuffer bytes, int length, @Nonnull GPFlags flags) in decode() argument
52 if (bytes.remaining() < length) { in decode()
53 throw new IOException("Only " + bytes.remaining() + " bytes exist in the buffer, but " in decode()
58 bytes.get(stringBytes); in decode()
109 ByteBuffer bytes = charset.encode(name); in encode() local
110 byte[] result = new byte[bytes.remaining()]; in encode()
111 bytes.get(result); in encode()
DStoredEntry.java357 public int read(byte[] bytes) throws IOException { in read() argument
358 if (bytes.length < getCentralDirectoryHeader().getUncompressedSize()) { in read()
363 return ByteStreams.read(is, bytes, 0, bytes.length); in read()
438 ByteBuffer bytes = ByteBuffer.wrap(localHeader); in readLocalHeader() local
439 F_LOCAL_SIGNATURE.verify(bytes); in readLocalHeader()
440 F_VERSION_EXTRACT.verify(bytes, compressInfo.getVersionExtract(), verifyLog); in readLocalHeader()
441 F_GP_BIT.verify(bytes, cdh.getGpBit().getValue(), verifyLog); in readLocalHeader()
442 F_METHOD.verify(bytes, compressInfo.getMethod().methodCode, verifyLog); in readLocalHeader()
445 F_LAST_MOD_TIME.skip(bytes); in readLocalHeader()
446 F_LAST_MOD_DATE.skip(bytes); in readLocalHeader()
[all …]
/tools/security/remote_provisioning/hwtrust/src/
Dcbor.rs15 fn value_from_bytes(mut bytes: &[u8]) -> Result<Value, CiboriumError> { in value_from_bytes()
16 let value = from_reader(bytes.by_ref())?; in value_from_bytes()
18 if !bytes.is_empty() { in value_from_bytes()
38 let bytes = [0x82, 0x04, 0x02]; // [4, 2] in value_from_bytes_valid_succeeds() localVariable
39 let val = value_from_bytes(&bytes)?; in value_from_bytes_valid_succeeds()
47 let bytes = [0x82, 0x04]; in value_from_bytes_truncated_fails() localVariable
48 assert!(value_from_bytes(&bytes).is_err()); in value_from_bytes_truncated_fails()
53 let bytes = [0x82, 0x04, 0x02, 0x00]; in value_from_bytes_trailing_bytes_fails() localVariable
54 assert!(value_from_bytes(&bytes).is_err()); in value_from_bytes_trailing_bytes_fails()
/tools/tradefederation/core/common_util/com/android/tradefed/util/
DByteArrayUtil.java44 byte[] bytes, int offset, int length, int containerSize) { in getByteBuffer() argument
47 data[i] = bytes[offset + i]; in getByteBuffer()
63 public static int getInt(byte[] bytes, int offset, int length) { in getInt() argument
64 return getByteBuffer(bytes, offset, length, 4).getInt(); in getInt()
78 public static long getLong(byte[] bytes, int offset, int length) { in getLong() argument
79 return getByteBuffer(bytes, offset, length, 8).getLong(); in getLong()
89 public static String getString(byte[] bytes, int offset, int length) { in getString() argument
90 return new String(Arrays.copyOfRange(bytes, offset, offset + length)); in getString()
DStreamUtil.java471 private static String bytesToHexString(byte[] bytes) { in bytesToHexString() argument
472 Objects.requireNonNull(bytes); in bytesToHexString()
473 StringBuilder sb = new StringBuilder(2 * bytes.length); in bytesToHexString()
474 for (int i = 0; i < bytes.length; i++) { in bytesToHexString()
475 int b = 0x0f & (bytes[i] >> 4); in bytesToHexString()
477 b = 0x0f & bytes[i]; in bytesToHexString()
/tools/apksig/src/main/java/com/android/apksig/internal/apk/v4/
DV4Signature.java49 static HashingInfo fromByteArray(byte[] bytes) throws IOException { in fromByteArray() argument
50 ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); in fromByteArray()
88 static SigningInfo fromByteArray(byte[] bytes) throws IOException { in fromByteArray() argument
89 return fromByteBuffer(ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN)); in fromByteArray()
156 public static SigningInfos fromByteArray(byte[] bytes) throws IOException { in fromByteArray() argument
157 ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN); in fromByteArray()
243 static int bytesSize(byte[] bytes) { in bytesSize() argument
244 return 4/*length*/ + (bytes == null ? 0 : bytes.length); in bytesSize()
273 final byte[] bytes = new byte[size]; in readBytes()
274 readFully(stream, bytes); in readBytes()
[all …]
/tools/treble/build/treble_build/local/
Dninja.go41 Command(ctx context.Context, target string) (*bytes.Buffer, error)
42 Input(ctx context.Context, target string) (*bytes.Buffer, error)
43 Query(ctx context.Context, target string) (*bytes.Buffer, error)
44 Path(ctx context.Context, target string, dependency string) (*bytes.Buffer, error)
45 Paths(ctx context.Context, target string, dependency string) (*bytes.Buffer, error)
46 Deps(ctx context.Context) (*bytes.Buffer, error)
47 Build(ctx context.Context, target string) (*bytes.Buffer, error)
61 func parseCommand(target string, data *bytes.Buffer) (*app.BuildCommand, error) {
75 func parseInput(target string, data *bytes.Buffer) (*app.BuildInput, error) {
83 func parseQuery(target string, data *bytes.Buffer) (*app.BuildQuery, error) {
[all …]
Dgit.go36 ProjectInfo(ctx context.Context, gitDir, workDir string) (out *bytes.Buffer, err error)
37 RemoteUrl(ctx context.Context, gitDir, workDir, remote string) (*bytes.Buffer, error)
38 Tree(ctx context.Context, gitDir, workDir, revision string) (*bytes.Buffer, error)
39 CommitInfo(ctx context.Context, gitDir, workDir, revision string) (*bytes.Buffer, error)
40 DiffBranches(ctx context.Context, gitDir, workDir, upstream, sha string) (*bytes.Buffer, error)
128 func parseProjectInfo(data *bytes.Buffer) (topLevel string, revision string, err error) {
139 func parseRemoteUrl(data *bytes.Buffer) (url string, err error) {
150 func parseLsTree(data *bytes.Buffer) ([]*app.GitTreeObj, error) {
164 func parseBranchDiff(data *bytes.Buffer) (map[string]*app.GitDiff, error) {
185 func parseCommitInfo(data *bytes.Buffer) (*app.GitCommit, error) {
[all …]
Dninja_test.go36 func (n *ninjaTest) Command(ctx context.Context, target string) (*bytes.Buffer, error) {
37 return bytes.NewBufferString(n.command.text), n.command.err
39 func (n *ninjaTest) Input(ctx context.Context, target string) (*bytes.Buffer, error) {
40 return bytes.NewBufferString(n.input.text), n.input.err
42 func (n *ninjaTest) Query(ctx context.Context, target string) (*bytes.Buffer, error) {
43 return bytes.NewBufferString(n.query.text), n.query.err
45 func (n *ninjaTest) Path(ctx context.Context, target string, dependency string) (*bytes.Buffer, err…
46 return bytes.NewBufferString(n.path.text), n.path.err
48 func (n *ninjaTest) Paths(ctx context.Context, target string, dependency string) (*bytes.Buffer, er…
49 return bytes.NewBufferString(n.paths.text), n.paths.err
[all …]
Dgit_test.go39 func (g *gitTestCli) ProjectInfo(ctx context.Context, gitDir, workDir string) (*bytes.Buffer, error…
40 return bytes.NewBufferString(g.revParse.text), g.revParse.err
42 func (g *gitTestCli) RemoteUrl(ctx context.Context, gitDir, workDir, remote string) (*bytes.Buffer,…
43 return bytes.NewBufferString(g.remoteUrl.text), g.remoteUrl.err
45 func (g *gitTestCli) Tree(ctx context.Context, gitDir, workDir, revision string) (*bytes.Buffer, er…
46 return bytes.NewBufferString(g.tree.text), g.tree.err
48 func (g *gitTestCli) CommitInfo(ctx context.Context, gitDir, workDir, sha string) (*bytes.Buffer, e…
49 return bytes.NewBufferString(g.commit.text), g.tree.err
51 …) DiffBranches(ctx context.Context, gitDir, workDir, upstream, sha string) (*bytes.Buffer, error) {
52 return bytes.NewBufferString(g.diffBranch.text), g.tree.err
Dcmd.go34 errorBuf := bytes.Buffer{}
53 func run(ctx context.Context, timeout time.Duration, cmdName string, args []string) (out *bytes.Buf…
58 errorBuf := bytes.Buffer{}
59 outputBuf := bytes.Buffer{}
/tools/netsim/rust/daemon/src/wifi/packets/
Dieee80211.rs36 let bytes = u64::to_le_bytes(self.0); in fmt() localVariable
40 bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], in fmt()
58 fn from(bytes: &[u8; 6]) -> Self { in from()
59 Self(u64::from_le_bytes([bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], 0, 0]))
65 let bytes = u64::to_le_bytes(addr); in from() localVariable
66 bytes[0..6].try_into().unwrap() in from()
268 let mut bytes = [0u8; 6]; in parse_mac_address() localVariable
271 Ok(n) => bytes[i] = n, in parse_mac_address()
275 Some(MacAddress::from(&bytes)) in parse_mac_address()
/tools/netsim/rust/daemon/src/captures/
Dpcap_util.rs115 let mut bytes = Vec::<u8>::with_capacity(header.len() + packet.len()); in wrap_bt_packet() localVariable
116 bytes.extend(&header); in wrap_bt_packet()
117 bytes.extend(packet); in wrap_bt_packet()
118 bytes in wrap_bt_packet()
135 let mut bytes = Vec::<u8>::with_capacity(header.len() + length); in append_record() localVariable
136 bytes.extend(&header); in append_record()
137 bytes.extend(packet); in append_record()
138 output.write_all(&bytes)?; in append_record()
/tools/security/fuzzing/llm/libufdt_fuzzer2/
Dlibufdt_fuzzer2.cpp25 auto bytes = stream.ConsumeBytes<uint8_t>(stream.remaining_bytes() / 2); in LLVMFuzzerTestOneInput() local
26 void *fdtp = bytes.data(); in LLVMFuzzerTestOneInput()
28 int isValidBuffer = fdt_check_full(bytes.data(), bytes.size()); in LLVMFuzzerTestOneInput()
/tools/test/connectivity/acts_tests/tests/google/wifi/aware/functional/
DMatchFilterTest.py34 MF_NNNNN = bytes([0x0, 0x0, 0x0, 0x0, 0x0])
35 MF_12345 = bytes([0x1, 0x1, 0x1, 0x2, 0x1, 0x3, 0x1, 0x4, 0x1, 0x5])
36 MF_12145 = bytes([0x1, 0x1, 0x1, 0x2, 0x1, 0x1, 0x1, 0x4, 0x1, 0x5])
37 MF_1N3N5 = bytes([0x1, 0x1, 0x0, 0x1, 0x3, 0x0, 0x1, 0x5])
38 MF_N23N5 = bytes([0x0, 0x1, 0x2, 0x1, 0x3, 0x0, 0x1, 0x5])
39 MF_N2N4 = bytes([0x0, 0x1, 0x2, 0x0, 0x1, 0x4])
40 MF_1N3N = bytes([0x1, 0x1, 0x0, 0x1, 0x3, 0x0])
/tools/test/connectivity/acts/framework/tests/
Dacts_job_test.py18 from builtins import bytes
42 self._stdout = bytes(stdout,
43 'utf-8') if stdout is not None else bytes()
44 self._stderr = bytes(stderr,
45 'utf-8') if stderr is not None else bytes()
/tools/security/fuzzing/example_java_jni_fuzzer_no_crash/
Dexample_jni.cpp34 JNIEnv *env, jobject o, jstring bytes) { in Java_ExampleJavaJniFuzzer_parse() argument
35 const char *input(env->GetStringUTFChars(bytes, nullptr)); in Java_ExampleJavaJniFuzzer_parse()
37 env->ReleaseStringUTFChars(bytes, input); in Java_ExampleJavaJniFuzzer_parse()
/tools/security/fuzzing/example_java_jni_fuzzer/
Dexample_jni.cpp39 JNIEnv *env, jobject o, jstring bytes) { in Java_ExampleJavaJniFuzzer_parse() argument
40 const char *input(env->GetStringUTFChars(bytes, nullptr)); in Java_ExampleJavaJniFuzzer_parse()
42 env->ReleaseStringUTFChars(bytes, input); in Java_ExampleJavaJniFuzzer_parse()
/tools/treble/hacksaw/config/
Dconfig_test.go38 var outputBuffer bytes.Buffer
43 if bytes.Compare(outputBuffer.Bytes(), expectedOutput) != 0 {
59 inputBuffer := bytes.NewBuffer(inputBytes)
/tools/test/connectivity/acts/framework/acts/libs/proc/
Djob.py73 stdout=bytes(),
74 stderr=bytes(),
143 out = bytes()
144 err = bytes()

12345