/tools/apksig/src/main/java/com/android/apksig/internal/util/ |
D | ByteArrayDataSink.java | 49 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 …]
|
D | ByteBufferDataSource.java | 55 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 …]
|
D | FileChannelDataSource.java | 56 public FileChannelDataSource(FileChannel channel, long offset, long size) { in FileChannelDataSource() argument 57 if (offset < 0) { in FileChannelDataSource() 64 mOffset = offset; in FileChannelDataSource() 82 public FileChannelDataSource slice(long offset, long size) { in slice() argument 84 checkChunkValid(offset, size, sourceSize); in slice() 85 if ((offset == 0) && (size == sourceSize)) { in slice() 89 return new FileChannelDataSource(mChannel, mOffset + offset, size); in slice() 93 public void feed(long offset, long size, DataSink sink) throws IOException { in feed() argument 95 checkChunkValid(offset, size, sourceSize); in feed() 100 long chunkOffsetInFile = mOffset + offset; in feed() [all …]
|
D | ChainedDataSource.java | 43 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 …]
|
D | RandomAccessFileDataSink.java | 66 public void consume(byte[] buf, int offset, int length) throws IOException { in consume() argument 67 if (offset < 0) { in consume() 70 throw new IndexOutOfBoundsException("offset: " + offset); in consume() 72 if (offset > buf.length) { in consume() 76 "offset: " + offset + ", buf.length: " + buf.length); in consume() 84 mFile.write(buf, offset, length); in consume()
|
/tools/external/fat32lib/src/main/java/de/waldheinz/fs/fat/ |
D | LittleEndian.java | 40 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 …]
|
D | Sector.java | 32 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 …]
|
D | FatUtils.java | 46 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()
|
D | FsInfoSector.java | 47 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
|
D | ClusterChain.java | 197 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 …]
|
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/sign/ |
D | ZFileDataSource.java | 42 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/tradefederation/core/common_util/com/android/tradefed/util/ |
D | ByteArrayUtil.java | 44 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()
|
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/zip/ |
D | ZipField.java | 66 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/dexter/slicer/ |
D | writer.cc | 102 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() 257 dex::u4 offset = 0; in CreateImage() local 261 offset += sizeof(dex::Header); in CreateImage() 262 offset += dex_->string_ids.Init(offset, dex_ir_->strings.size()); in CreateImage() [all …]
|
D | code_ir.cc | 64 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 …]
|
/tools/dexter/slicer/export/slicer/ |
D | reader.h | 74 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 …]
|
D | buffer.h | 75 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/apksig/src/test/java/com/android/apksig/util/ |
D | DataSourceTestBase.java | 223 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 …]
|
D | DataSourceFromRAFFactory.java | 27 @Override DataSource create(RandomAccessFile file, long offset, long size) { in create() argument 28 return DataSources.asDataSource(file, offset, size); in create() 36 @Override DataSource create(RandomAccessFile file, long offset, long size) { in create() argument 37 return DataSources.asDataSource(file.getChannel(), offset, size); in create() 42 abstract DataSource create(RandomAccessFile file, long offset, long size); in create() argument
|
/tools/tradefederation/core/common_util/com/android/tradefed/util/zip/ |
D | EndCentralDirectoryInfo.java | 159 int offset = (int) size - CENTRAL_DIRECTORY_MAGIC_LENGTH - 1; in getEndCentralDirectoryInfo() local 161 while (offset >= 0) { in getEndCentralDirectoryInfo() 164 Arrays.copyOfRange(endCentralDir, offset, offset + 4))) { in getEndCentralDirectoryInfo() 165 offset--; in getEndCentralDirectoryInfo() 170 if (offset < 0) { in getEndCentralDirectoryInfo() 175 return Arrays.copyOfRange(endCentralDir, offset, offset + 64); in getEndCentralDirectoryInfo()
|
/tools/apksig/src/main/java/com/android/apksig/util/ |
D | DataSource.java | 69 void feed(long offset, long size, DataSink sink) throws IOException; in feed() argument 85 ByteBuffer getByteBuffer(long offset, int size) throws IOException; in getByteBuffer() argument 97 void copyTo(long offset, int size, ByteBuffer dest) throws IOException; in copyTo() argument 109 DataSource slice(long offset, long size); in slice() argument
|
/tools/tradefederation/core/tests/src/com/android/tradefed/util/ |
D | FixedByteArrayOutputStreamTest.java | 113 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/apksig/src/test/java/com/android/apksig/internal/util/ |
D | FileChannelDataSourceTest.java | 63 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/apkzlib/src/test/java/com/android/tools/build/apkzlib/zfile/ |
D | ApkAlignmentTest.java | 70 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/apksig/src/main/java/com/android/apksig/ |
D | Hints.java | 53 final long offset; field in Hints.PatternWithRange 58 this.offset= 0; in PatternWithRange() 62 public PatternWithRange(String pattern, long offset, long size) { in PatternWithRange() argument 64 this.offset = offset; in PatternWithRange() 73 if (rangeIn.end - rangeIn.start < this.offset) { in ClampToAbsoluteByteRange() 76 long rangeOutStart = rangeIn.start + this.offset; in ClampToAbsoluteByteRange()
|