Home
last modified time | relevance | path

Searched refs:offset (Results 1 – 25 of 124) sorted by relevance

12345

/tools/apksig/src/main/java/com/android/apksig/internal/util/
DByteArrayDataSink.java49 public void consume(byte[] buf, int offset, int length) throws IOException { in consume() argument
50 if (offset < 0) { in consume()
53 throw new IndexOutOfBoundsException("offset: " + offset); in consume()
55 if (offset > buf.length) { in consume()
59 "offset: " + offset + ", buf.length: " + buf.length); in consume()
66 System.arraycopy(buf, offset, mArray, mSize, length); in consume()
116 public ByteBuffer getByteBuffer(long offset, int size) { in getByteBuffer() argument
117 checkChunkValid(offset, size); in getByteBuffer()
120 return ByteBuffer.wrap(mArray, (int) offset, size).slice(); in getByteBuffer()
124 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument
[all …]
DRandomAccessFileDataSource.java56 public RandomAccessFileDataSource(RandomAccessFile file, long offset, long size) { in RandomAccessFileDataSource() argument
57 this(file.getChannel(), offset, size); in RandomAccessFileDataSource()
60 private RandomAccessFileDataSource(FileChannel channel, long offset, long size) { in RandomAccessFileDataSource() argument
61 if (offset < 0) { in RandomAccessFileDataSource()
68 mOffset = offset; in RandomAccessFileDataSource()
86 public RandomAccessFileDataSource slice(long offset, long size) { in slice() argument
88 checkChunkValid(offset, size, sourceSize); in slice()
89 if ((offset == 0) && (size == sourceSize)) { in slice()
93 return new RandomAccessFileDataSource(mChannel, mOffset + offset, size); in slice()
97 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument
[all …]
DChainedDataSource.java43 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument
44 if (offset + size > mTotalSize) { in feed()
50 if (offset >= src.size()) { in feed()
51 offset -= src.size(); in feed()
56 long remaining = src.size() - offset; in feed()
58 src.feed(offset, size, sink); in feed()
63 src.feed(offset, remaining, sink); in feed()
65 offset = 0; in feed()
70 public ByteBuffer getByteBuffer(long offset, int size) throws IOException { in getByteBuffer() argument
71 if (offset + size > mTotalSize) { in getByteBuffer()
[all …]
DByteBufferDataSource.java55 public ByteBuffer getByteBuffer(long offset, int size) { in getByteBuffer() argument
56 checkChunkValid(offset, size); in getByteBuffer()
59 int chunkPosition = (int) offset; in getByteBuffer()
78 public void copyTo(long offset, int size, ByteBuffer dest) { in copyTo() argument
79 dest.put(getByteBuffer(offset, size)); in copyTo()
83 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument
87 sink.consume(getByteBuffer(offset, (int) size)); in feed()
91 public ByteBufferDataSource slice(long offset, long size) { in slice() argument
92 if ((offset == 0) && (size == mSize)) { in slice()
99 getByteBuffer(offset, (int) size), in slice()
[all …]
/tools/dexter/slicer/
Dwriter.cc102 SLICER_EXTRA(auto offset = data.size()); in WriteEncodedValue()
190 auto ptr = data.ptr<const dex::u1>(offset); in WriteEncodedValue()
191 auto size = data.size() - offset; in WriteEncodedValue()
227 dex::u4 offset = section.SectionOffset(); in CopySection() local
229 SLICER_CHECK(offset >= sizeof(dex::Header)); in CopySection()
230 SLICER_CHECK(offset + size <= image_size); in CopySection()
232 ::memcpy(image + offset, section.data(), size); in CopySection()
250 dex::u4 offset = 0; in CreateImage() local
254 offset += sizeof(dex::Header); in CreateImage()
255 offset += dex_->string_ids.Init(offset, dex_ir_->strings.size()); in CreateImage()
[all …]
Dcode_ir.cc64 try_block_begin->offset = tryBlock.start_addr; in DissasembleTryBlocks()
68 try_block_end->offset = tryBlock.start_addr + tryBlock.insn_count; in DissasembleTryBlocks()
123 dbg_header->offset = 0; in DissasembleDebugInfo()
130 annotation->offset = 0; in DissasembleDebugInfo()
139 annotation->offset = 0; in DissasembleDebugInfo()
233 annotation->offset = address; in DissasembleDebugInfo()
248 dex::u4 offset = ptr - begin; in DissasembleBytecode() local
253 instr = DecodePackedSwitch(ptr, offset); in DissasembleBytecode()
257 instr = DecodeSparseSwitch(ptr, offset); in DissasembleBytecode()
261 instr = DecodeArrayData(ptr, offset); in DissasembleBytecode()
[all …]
Dbytecode_encoder.cc126 bytecode->offset = offset_; in Visit()
212 if (label->offset != kInvalidOffset) { in Visit()
213 assert(label->offset <= offset_); in Visit()
214 A = label->offset - offset_; in Visit()
229 if (label->offset != kInvalidOffset) { in Visit()
231 assert(label->offset <= offset_); in Visit()
232 A = label->offset - offset_; in Visit()
247 if (label->offset != kInvalidOffset) { in Visit()
248 assert(label->offset <= offset_); in Visit()
249 B = label->offset - offset_; in Visit()
[all …]
Dreader.cc280 ir::AnnotationsDirectory* Reader::ExtractAnnotations(dex::u4 offset) { in ExtractAnnotations() argument
281 if (offset == 0) { in ExtractAnnotations()
285 SLICER_CHECK(offset % 4 == 0); in ExtractAnnotations()
288 auto& ir_annotations = annotations_directories_[offset]; in ExtractAnnotations()
292 auto dex_annotations = dataPtr<dex::AnnotationsDirectoryItem>(offset); in ExtractAnnotations()
314 ir::Annotation* Reader::ExtractAnnotationItem(dex::u4 offset) { in ExtractAnnotationItem() argument
315 SLICER_CHECK(offset != 0); in ExtractAnnotationItem()
318 auto& ir_annotation = annotations_[offset]; in ExtractAnnotationItem()
320 auto dexAnnotationItem = dataPtr<dex::AnnotationItem>(offset); in ExtractAnnotationItem()
328 ir::AnnotationSet* Reader::ExtractAnnotationSet(dex::u4 offset) { in ExtractAnnotationSet() argument
[all …]
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/sign/
DZFileDataSource.java42 private final long offset; field in ZFileDataSource
57 offset = 0; in ZFileDataSource()
66 public ZFileDataSource(@Nonnull ZFile file, long offset, long size) { in ZFileDataSource() argument
67 Preconditions.checkArgument(offset >= 0, "offset < 0"); in ZFileDataSource()
70 this.offset = offset; in ZFileDataSource()
90 public DataSource slice(long offset, long size) { in slice() argument
92 checkChunkValid(offset, size, sourceSize); in slice()
93 if ((offset == 0) && (size == sourceSize)) { in slice()
97 return new ZFileDataSource(file, this.offset + offset, size); in slice()
101 public void feed(long offset, long size, @Nonnull DataSink sink) throws IOException { in feed() argument
[all …]
/tools/external/fat32lib/src/main/java/de/waldheinz/fs/fat/
DLittleEndian.java40 public static int getUInt8(byte[] src, int offset) { in getUInt8() argument
41 return src[offset] & 0xFF; in getUInt8()
50 public static int getUInt16(byte[] src, int offset) { in getUInt16() argument
51 final int v0 = src[offset + 0] & 0xFF; in getUInt16()
52 final int v1 = src[offset + 1] & 0xFF; in getUInt16()
62 public static long getUInt32(byte[] src, int offset) { in getUInt32() argument
63 final long v0 = src[offset + 0] & 0xFF; in getUInt32()
64 final long v1 = src[offset + 1] & 0xFF; in getUInt32()
65 final long v2 = src[offset + 2] & 0xFF; in getUInt32()
66 final long v3 = src[offset + 3] & 0xFF; in getUInt32()
[all …]
DSector.java32 private final long offset; field in Sector
41 protected Sector(BlockDevice device, long offset, int size) { in Sector() argument
42 this.offset = offset; in Sector()
59 device.read(offset, buffer); in read()
85 device.write(offset, buffer); in write()
89 protected int get16(int offset) { in get16() argument
90 return buffer.getShort(offset) & 0xffff; in get16()
93 protected long get32(int offset) { in get32() argument
94 return buffer.getInt(offset) & 0xffffffff; in get32()
97 protected int get8(int offset) { in get8() argument
[all …]
DClusterChain.java197 public void readData(long offset, ByteBuffer dest) in readData() argument
207 int chainIdx = (int) (offset / clusterSize); in readData()
208 if (offset % clusterSize != 0) { in readData()
209 int clusOfs = (int) (offset % clusterSize); in readData()
211 (int) (clusterSize - (offset % clusterSize) - 1)); in readData()
216 offset += size; in readData()
243 public void writeData(long offset, ByteBuffer srcBuf) throws IOException { in writeData() argument
249 final long minSize = offset + len; in writeData()
256 int chainIdx = (int) (offset / clusterSize); in writeData()
257 if (offset % clusterSize != 0) { in writeData()
[all …]
DFatUtils.java46 long offset = resSects * sectSize; in getFatOffset() local
49 offset += fatNr * fatSize; in getFatOffset()
51 return offset; in getFatOffset()
66 long offset = getFatOffset(bs, 0); in getRootDirOffset() local
68 offset += fats * sectsPerFat * sectSize; in getRootDirOffset()
70 return offset; in getRootDirOffset()
81 long offset = getRootDirOffset(bs); in getFilesOffset() local
83 offset += bs.getRootDirEntryCount() * 32; in getFilesOffset()
85 return offset; in getFilesOffset()
DFsInfoSector.java47 private FsInfoSector(BlockDevice device, long offset) { in FsInfoSector() argument
48 super(device, offset, BootSector.SIZE); in FsInfoSector()
63 new FsInfoSector(bs.getDevice(), offset(bs)); in read()
80 final int offset = offset(bs); in create() local
82 if (offset == 0) throw new IOException( in create()
86 new FsInfoSector(bs.getDevice(), offset(bs)); in create()
93 private static int offset(Fat32BootSector bs) { in offset() method in FsInfoSector
/tools/metalava/src/main/java/com/android/tools/metalava/model/psi/
DJavadoc.kt141 val offset = if (lastTag != null) { in mergeDocumentation() constant
146 return insertInto(doc, "@return $newText", offset) in mergeDocumentation()
149 val offset = if (append) in mergeDocumentation() constant
152 return insertInto(doc, newText, offset) in mergeDocumentation()
169 val offset = when { in mergeDocumentation() constant
175 return insertInto(doc, "$tagName $newText", offset) in mergeDocumentation()
178 val offset = if (append) in mergeDocumentation() constant
181 return insertInto(doc, newText, offset) in mergeDocumentation()
241 …val offset = if (initialOffset > 4 && existingDoc.regionMatches(initialOffset - 4, "\n * ", 0, 4, … in insertInto() constant
250 val prefix = existingDoc.substring(0, offset) in insertInto()
[all …]
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/zip/
DZipField.java66 protected final int offset; field in ZipField
93 ZipField(int offset, int size, @Nonnull String name, ZipFieldInvariant... invariants) { in ZipField() argument
94 Preconditions.checkArgument(offset >= 0, "offset >= 0"); in ZipField()
98 this.offset = offset; in ZipField()
112 ZipField(int offset, int size, long expected, @Nonnull String name) { in ZipField() argument
113 Preconditions.checkArgument(offset >= 0, "offset >= 0"); in ZipField()
117 this.offset = offset; in ZipField()
296 int offset() { in offset() method in ZipField
297 return offset; in offset()
307 return offset + size; in endOffset()
[all …]
/tools/apksig/src/test/java/com/android/apksig/util/
DDataSourceTestBase.java223 String expectedContents, DataSource ds, long offset, int size) throws IOException { in assertSliceEquals() argument
224 DataSource slice = ds.slice(offset, size); in assertSliceEquals()
229 protected static void assertSliceThrowsIOOB(DataSource ds, long offset, int size) { in assertSliceThrowsIOOB() argument
231 ds.slice(offset, size); in assertSliceThrowsIOOB()
237 String expectedContents, DataSource ds, long offset, int size) throws IOException { in assertGetByteBufferEquals() argument
238 ByteBuffer buf = ds.getByteBuffer(offset, size); in assertGetByteBufferEquals()
245 protected static void assertGetByteBufferThrowsIOOB(DataSource ds, long offset, int size) in assertGetByteBufferThrowsIOOB() argument
248 ds.getByteBuffer(offset, size); in assertGetByteBufferThrowsIOOB()
254 String expectedFedContents, DataSource ds, long offset, int size) throws IOException { in assertFeedEquals() argument
256 ds.feed(offset, size, out); in assertFeedEquals()
[all …]
/tools/dexter/slicer/export/slicer/
Dreader.h74 ir::AnnotationsDirectory* ExtractAnnotations(dex::u4 offset);
75 ir::Annotation* ExtractAnnotationItem(dex::u4 offset);
76 ir::AnnotationSet* ExtractAnnotationSet(dex::u4 offset);
77 ir::AnnotationSetRefList* ExtractAnnotationSetRefList(dex::u4 offset);
87 ir::EncodedArray* ExtractEncodedArray(dex::u4 offset);
95 ir::TypeList* ExtractTypeList(dex::u4 offset);
100 ir::DebugInfo* ExtractDebugInfo(dex::u4 offset);
101 ir::Code* ExtractCode(dex::u4 offset);
106 const T* ptr(int offset) const { in ptr() argument
107 SLICER_CHECK(offset >= 0 && offset + sizeof(T) <= size_); in ptr()
[all …]
Dbuffer.h75 T* ptr(size_t offset) { in ptr() argument
76 SLICER_CHECK(offset + sizeof(T) <= size_); in ptr()
77 return reinterpret_cast<T*>(buff_ + offset); in ptr()
90 size_t offset = size_; in Alloc() local
92 std::memset(buff_ + offset, 0, size); in Alloc()
93 return offset; in Alloc()
97 size_t offset = size_; in Push() local
99 std::memcpy(buff_ + offset, ptr, size); in Push()
100 return offset; in Push()
/tools/apkzlib/src/test/java/com/android/tools/build/apkzlib/zfile/
DApkAlignmentTest.java70 long offset = in soFilesUncompressedAndAligned() local
72 assertTrue(offset % 4096 == 0); in soFilesUncompressedAndAligned()
91 long offset = in soFilesMergedFromZipsCanBeUncompressedAndAligned() local
93 assertFalse(offset % 4096 == 0); in soFilesMergedFromZipsCanBeUncompressedAndAligned()
123 long offset = in soFilesMergedFromZipsCanBeUncompressedAndAligned() local
125 assertTrue(offset % 4096 == 0); in soFilesMergedFromZipsCanBeUncompressedAndAligned()
167 long offset = in soFilesUncompressedAndNotAligned() local
169 assertTrue(offset % 4096 != 0); in soFilesUncompressedAndNotAligned()
188 long offset = in soFilesMergedFromZipsCanBeUncompressedAndNotAligned() local
190 assertFalse(offset % 4096 == 0); in soFilesMergedFromZipsCanBeUncompressedAndNotAligned()
[all …]
/tools/test/connectivity/acts/framework/acts/controllers/
Dmonsoon.py422 def __init__(self, data_points, timestamps, hz, voltage, offset=0): argument
435 self.offset = offset
437 if self.offset >= num_of_data_pt:
440 "number of data points (%d).") % (offset, num_of_data_pt))
441 self.data_points = self._data_points[self.offset:]
442 self.timestamps = self._timestamps[self.offset:]
574 self.offset = new_offset
575 self.data_points = self._data_points[self.offset:]
576 self.timestamps = self._timestamps[self.offset:]
620 len(self._data_points), self.hz, self.offset))
[all …]
/tools/apksig/src/main/java/com/android/apksig/internal/zip/
DZipUtils.java58 ByteBuffer zipEndOfCentralDirectory, long offset) { in setZipEocdCentralDirectoryOffset() argument
63 offset); in setZipEocdCentralDirectoryOffset()
242 public static int getUnsignedInt16(ByteBuffer buffer, int offset) { in getUnsignedInt16() argument
243 return buffer.getShort(offset) & 0xffff; in getUnsignedInt16()
250 static void setUnsignedInt16(ByteBuffer buffer, int offset, int value) { in setUnsignedInt16() argument
254 buffer.putShort(offset, (short) value); in setUnsignedInt16()
257 static void setUnsignedInt32(ByteBuffer buffer, int offset, long value) { in setUnsignedInt32() argument
261 buffer.putInt(offset, (int) value); in setUnsignedInt32()
271 static long getUnsignedInt32(ByteBuffer buffer, int offset) { in getUnsignedInt32() argument
272 return buffer.getInt(offset) & 0xffffffffL; in getUnsignedInt32()
/tools/apksig/src/test/java/com/android/apksig/internal/util/
DRandomAccessFileDataSourceTest.java63 int offset = 23456; in testFeedsCorrectData_whenFilePartiallyReadWithOffset() local
65 rafDataSource.feed(offset, bytesToFeed, dataSink); in testFeedsCorrectData_whenFilePartiallyReadWithOffset()
67 byte[] expectedBytes = Arrays.copyOfRange(fullFileContent, offset, offset + bytesToFeed); in testFeedsCorrectData_whenFilePartiallyReadWithOffset()
82 int offset = 23456; in testFeedsCorrectData_whenSeveralMbRead() local
84 rafDataSource.feed(offset, bytesToFeed, dataSink); in testFeedsCorrectData_whenSeveralMbRead()
86 byte[] expectedBytes = Arrays.copyOfRange(fullFileContent, offset, offset + bytesToFeed); in testFeedsCorrectData_whenSeveralMbRead()
/tools/tradefederation/core/tests/src/com/android/tradefed/util/
DFixedByteArrayOutputStreamTest.java113 int offset = 5; in testLessThanBufferWithOffset() local
114 String expected = text.substring(offset); in testLessThanBufferWithOffset()
115 mOutStream.write(text.getBytes(), offset, text.length() - offset); in testLessThanBufferWithOffset() local
130 int offset = 4; in testWriteWithOffsetAndWrap() local
131 String full = prefix + followup.substring(offset); in testWriteWithOffsetAndWrap()
134 mOutStream.write(followup.getBytes(), offset, followup.length() - offset); in testWriteWithOffsetAndWrap() local
/tools/test/connectivity/acts/framework/acts/test_utils/bt/
Dgatts_lib.py151 offset = event['data']['offset']
187 format(request_id, status, offset, data))
188 data = data[offset:offset + mtu - 1]
190 self.gatt_server, 0, request_id, status, offset, data)
283 offset = 0
305 "data] [{}, {}, {}, {}]".format(request_id, status, offset,
308 self.gatt_server, 0, request_id, status, offset, data)
324 offset = 0
350 offset = event['data']['offset']
373 self.gatt_server, 0, request_id, status, offset, [1])
[all …]

12345