Home
last modified time | relevance | path

Searched refs:size (Results 1 – 25 of 190) sorted by relevance

12345678

/tools/apksig/src/test/java/com/android/apksig/util/
DDataSourceTestBase.java51 assertEquals(10, ds.size()); in testSize()
66 assertSliceEquals("", ds, ds.size() - 2, 0); in testSlice()
67 assertSliceEquals("", ds, ds.size() - 1, 0); in testSlice()
68 assertSliceEquals("", ds, ds.size(), 0); in testSlice()
71 assertSliceEquals("", slice, slice.size() - 2, 0); in testSlice()
72 assertSliceEquals("", slice, slice.size() - 1, 0); in testSlice()
73 assertSliceEquals("", slice, slice.size(), 0); in testSlice()
84 assertSliceThrowsIOOB(ds, ds.size() + 1, 0); in testSlice()
85 assertSliceThrowsIOOB(slice, slice.size() + 1, 0); in testSlice()
86 assertSliceThrowsIOOB(ds, ds.size(), 1); in testSlice()
[all …]
DDataSourceFromRAFChunkTest.java50 assertGetByteBufferEquals("abcdefg", ds, 0, (int) ds.size()); in testFileSizeChangesNotVisible()
51 assertGetByteBufferEquals("de", slice, 0, (int) slice.size()); in testFileSizeChangesNotVisible()
63 assertGetByteBufferEquals("abcdefg", ds, 0, (int) ds.size()); in testFileSizeChangesNotVisible()
64 assertGetByteBufferEquals("de", slice, 0, (int) slice.size()); in testFileSizeChangesNotVisible()
65 assertGetByteBufferThrowsIOOB(ds, 0, (int) ds.size() + 3); in testFileSizeChangesNotVisible()
66 assertFeedThrowsIOOB(ds, 0, (int) ds.size() + 3); in testFileSizeChangesNotVisible()
67 assertSliceThrowsIOOB(ds, 0, (int) ds.size() + 3); in testFileSizeChangesNotVisible()
68 assertCopyToThrowsIOOB(ds, 0, (int) ds.size() + 3); in testFileSizeChangesNotVisible()
DDataSourceFromRAFFactory.java27 @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/apksig/src/main/java/com/android/apksig/internal/util/
DFileChannelDataSource.java56 public FileChannelDataSource(FileChannel channel, long offset, long size) { in FileChannelDataSource() argument
58 throw new IndexOutOfBoundsException("offset: " + size); in FileChannelDataSource()
60 if (size < 0) { in FileChannelDataSource()
61 throw new IndexOutOfBoundsException("size: " + size); in FileChannelDataSource()
65 mSize = size; in FileChannelDataSource()
69 public long size() { in size() method in FileChannelDataSource
72 return mChannel.size(); in size()
82 public FileChannelDataSource slice(long offset, long size) { in slice() argument
83 long sourceSize = size(); in slice()
84 checkChunkValid(offset, size, sourceSize); in slice()
[all …]
DByteArrayDataSink.java111 public long size() { in size() method in ByteArrayDataSink
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
125 checkChunkValid(offset, size); in feed()
128 sink.consume(mArray, (int) offset, (int) size); in feed()
132 public void copyTo(long offset, int size, ByteBuffer dest) throws IOException { in copyTo() argument
133 checkChunkValid(offset, size); in copyTo()
136 dest.put(mArray, (int) offset, size); in copyTo()
[all …]
DByteBufferDataSource.java50 public long size() { in size() method in ByteBufferDataSource
55 public ByteBuffer getByteBuffer(long offset, int size) { in getByteBuffer() argument
56 checkChunkValid(offset, size); in getByteBuffer()
60 int chunkLimit = chunkPosition + size; 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
84 if ((size < 0) || (size > mSize)) { in feed()
85 throw new IndexOutOfBoundsException("size: " + size + ", source size: " + mSize); in feed()
87 sink.consume(getByteBuffer(offset, (int) size)); in feed()
[all …]
DChainedDataSource.java34 mTotalSize = Arrays.stream(sources).mapToLong(src -> src.size()).sum(); in ChainedDataSource()
38 public long size() { in size() method in ChainedDataSource
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()
57 if (remaining >= size) { in feed()
58 src.feed(offset, size, sink); in feed()
64 size -= remaining; in feed()
[all …]
DVerityTreeBuilder.java105 if (beforeApkSigningBlock.size() % CHUNK_SIZE != 0) { in generateVerityTreeRootHash()
107 + ": " + beforeApkSigningBlock.size()); in generateVerityTreeRootHash()
113 long centralDirOffsetForDigesting = beforeApkSigningBlock.size(); in generateVerityTreeRootHash()
114 ByteBuffer eocdBuf = ByteBuffer.allocate((int) eocd.size()); in generateVerityTreeRootHash()
116 eocd.copyTo(0, (int) eocd.size(), eocdBuf); in generateVerityTreeRootHash()
150 int[] levelOffset = calculateLevelOffset(fileSource.size(), digestSize); in generateVerityTree()
169 long totalOutput = divideRoundup(src.size(), CHUNK_SIZE) * digestSize; in generateVerityTree()
198 long size = CHUNK_SIZE * divideRoundup(chunkCount * digestSize, CHUNK_SIZE); in calculateLevelOffset() local
199 levelSize.add(size); in calculateLevelOffset()
207 int[] levelOffset = new int[levelSize.size() + 1]; in calculateLevelOffset()
[all …]
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/sign/
DZFileDataSource.java48 private final long size; field in ZFileDataSource
58 size = -1; in ZFileDataSource()
66 public ZFileDataSource(@Nonnull ZFile file, long offset, long size) { in ZFileDataSource() argument
68 Preconditions.checkArgument(size >= 0, "size < 0"); in ZFileDataSource()
71 this.size = size; in ZFileDataSource()
75 public long size() { in size() method in ZFileDataSource
76 if (size == -1) { in size()
85 return size; in size()
90 public DataSource slice(long offset, long size) { in slice() argument
91 long sourceSize = size(); in slice()
[all …]
/tools/apksig/src/test/java/com/android/apksig/internal/util/
DChainedDataSourceTest.java47 assertEquals(10, mChain.size()); in setUp()
51 for (int begin = 0; begin < mChain.size(); begin++) { in feedAllPossibleRanges()
52 for (int end = begin + 1; end < mChain.size(); end++) { in feedAllPossibleRanges()
53 int size = end - begin; in feedAllPossibleRanges() local
54 ReadableDataSink sink = DataSinks.newInMemoryDataSink(size); in feedAllPossibleRanges()
55 mChain.feed(begin, size, sink); in feedAllPossibleRanges()
58 sink.getByteBuffer(0, size)); in feedAllPossibleRanges()
65 mChain.feed(0, mChain.size() + 1, DataSinks.newInMemoryDataSink(3)); in feedMoreThanAvailable()
69 for (int begin = 0; begin < mChain.size(); begin++) { in getByteBufferFromAllPossibleRanges()
70 for (int end = begin + 1; end < mChain.size(); end++) { in getByteBufferFromAllPossibleRanges()
[all …]
/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/zip/
DFileUseMap.java55 private long size; field in FileUseMap
83 FileUseMap(long size, int minFreeSize) { in FileUseMap() argument
84 Preconditions.checkArgument(size >= 0, "size < 0"); in FileUseMap()
87 this.size = size; in FileUseMap()
92 if (size > 0) { in FileUseMap()
93 internalAdd(FileUseMapEntry.makeFree(0, size)); in FileUseMap()
132 Preconditions.checkArgument(entry.getStart() < size, "entry.getStart() >= size"); in add()
133 Preconditions.checkArgument(entry.getEnd() <= size, "entry.getEnd() > size"); in add()
264 if (end < size) { in coalesce()
299 if (size == 0) { in truncate()
[all …]
DZipField.java71 private final int size; field in ZipField
93 ZipField(int offset, int size, @Nonnull String name, ZipFieldInvariant... invariants) { in ZipField() argument
95 Preconditions.checkArgument(size == 2 || size == 4, "size != 2 && size != 4"); in ZipField()
99 this.size = size; in ZipField()
112 ZipField(int offset, int size, long expected, @Nonnull String name) { in ZipField() argument
114 Preconditions.checkArgument(size == 2 || size == 4, "size != 2 && size != 4"); in ZipField()
118 this.size = size; in ZipField()
147 if (bytes.remaining() < size) { in skip()
152 bytes.position(bytes.position() + size); in skip()
164 if (bytes.remaining() < size) { in read()
[all …]
/tools/dexter/dexter/
Ddexter.cc131 for (dex::u4 i = 0; i < dexMap.size; ++i) { in PrintDexMap()
191 dex::u4 sectionByteSize = (i == dexMap.size - 1) in PrintDexMap()
196 sectionByteSize, section.size); in PrintDexMap()
203 printf(" strings : %zu\n", dex_ir->strings.size()); in PrintDexIrStats()
204 printf(" types : %zu\n", dex_ir->types.size()); in PrintDexIrStats()
205 printf(" protos : %zu\n", dex_ir->protos.size()); in PrintDexIrStats()
206 printf(" fields : %zu\n", dex_ir->fields.size()); in PrintDexIrStats()
207 printf(" encoded_fields : %zu\n", dex_ir->encoded_fields.size()); in PrintDexIrStats()
208 printf(" methods : %zu\n", dex_ir->methods.size()); in PrintDexIrStats()
209 printf(" encoded_methods : %zu\n", dex_ir->encoded_methods.size()); in PrintDexIrStats()
[all …]
/tools/security/fuzzing/orphans/libcppbor/
Dcppbor_parse_fuzzer.cpp33 void FuzzParse(const uint8_t* data, size_t size) { in FuzzParse() argument
35 const uint8_t* end = data + size; in FuzzParse()
45 void FuzzParseWithViews(const uint8_t* data, size_t size) { in FuzzParseWithViews() argument
47 const uint8_t* end = data + size; in FuzzParseWithViews()
57 void FuzzParseWithClient(const uint8_t* data, size_t size) { in FuzzParseWithClient() argument
58 const uint8_t* end = data + size; in FuzzParseWithClient()
63 void FuzzParseWithClientAndViews(const uint8_t* data, size_t size) { in FuzzParseWithClientAndViews() argument
64 const uint8_t* end = data + size; in FuzzParseWithClientAndViews()
69 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { in LLVMFuzzerTestOneInput() argument
70 FuzzParse(data, size); in LLVMFuzzerTestOneInput()
[all …]
Dcppbor_fuzzer.cpp21 void FuzzStringParsing(const uint8_t* data, size_t size) { in FuzzStringParsing() argument
22 FuzzedDataProvider dataProvider(data, size); in FuzzStringParsing()
28 void FuzzVectorParsing(const uint8_t* data, size_t size) { in FuzzVectorParsing() argument
29 FuzzedDataProvider dataProvider(data, size); in FuzzVectorParsing()
39 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { in LLVMFuzzerTestOneInput() argument
40 FuzzStringParsing(data, size); in LLVMFuzzerTestOneInput()
41 FuzzVectorParsing(data, size); in LLVMFuzzerTestOneInput()
/tools/dexter/slicer/export/slicer/
Dbuffer.h66 return size(); in Seal()
89 size_t Alloc(size_t size) { in Alloc() argument
91 Expand(size); in Alloc()
92 std::memset(buff_ + offset, 0, size); in Alloc()
96 size_t Push(const void* ptr, size_t size) { in Push() argument
98 Expand(size); in Push()
99 std::memcpy(buff_ + offset, ptr, size); in Push()
104 return Push(memView.ptr(), memView.size()); in Push()
109 return Push(a.data(), a.size() * sizeof(T)); in Push()
114 return Push(v.data(), v.size() * sizeof(T)); in Push()
[all …]
/tools/trebuchet/core/common/src/main/kotlin/trebuchet/util/
DByteArrayList.kt24 var size: Int = 0 variable
28 get() = array.size
42 capacity = size + 1 in put()
43 array[size] = b in put()
44 size++ in put()
48 capacity = size + length in put()
49 System.arraycopy(buf, offset, array, size, length) in put()
50 size += length in put()
58 val slice = array.asSlice(size) in reset()
60 size = 0 in reset()
/tools/dexter/slicer/
Dwriter.cc68 size_t size = dst - buff; in WriteIntValue() local
69 assert(size > 0 && size <= sizeof(T)); in WriteIntValue()
70 WriteEncodedValueHeader(type, size - 1, data); in WriteIntValue()
71 data.Push(buff, size); in WriteIntValue()
79 size_t size = sizeof(T); in WriteFloatValue() local
82 while (size > 1 && *src == 0) { in WriteFloatValue()
83 --size; in WriteFloatValue()
88 for (size_t i = 0; i < size; ++i) { in WriteFloatValue()
92 assert(size > 0 && size <= sizeof(T)); in WriteFloatValue()
93 WriteEncodedValueHeader(type, size - 1, data); in WriteFloatValue()
[all …]
Dbytecode_encoder.cc136 auto buff_offset = bytecode_.size(); in Visit()
142 SLICER_CHECK(bytecode->operands.size() == 0); in Visit()
148 SLICER_CHECK(bytecode->operands.size() == 2); in Visit()
156 SLICER_CHECK(bytecode->operands.size() == 2); in Visit()
165 SLICER_CHECK(bytecode->operands.size() == 2); in Visit()
175 SLICER_CHECK(bytecode->operands.size() == 2); in Visit()
183 SLICER_CHECK(bytecode->operands.size() == 2); in Visit()
192 SLICER_CHECK(bytecode->operands.size() == 1); in Visit()
199 SLICER_CHECK(bytecode->operands.size() == 2); in Visit()
209 SLICER_CHECK(bytecode->operands.size() == 1); in Visit()
[all …]
/tools/external/fat32lib/src/main/java/de/waldheinz/fs/util/
DRamDisk.java43 private final int size; field in RamDisk
77 this.size = buffer.limit(); in RamDisk()
89 public RamDisk(int size) { in RamDisk() argument
90 this(size, DEFAULT_SECTOR_SIZE); in RamDisk()
100 public RamDisk(int size, int sectorSize) { in RamDisk() argument
105 this.size = size; in RamDisk()
106 this.data = ByteBuffer.allocate(size); in RamDisk()
112 return this.size; in getSize()
/tools/apksig/src/main/java/com/android/apksig/internal/apk/
DApkSigningBlockUtils.java154 ZipUtils.setZipEocdCentralDirectoryOffset(modifiedEocd, beforeApkSigningBlock.size()); in verifyIntegrity()
166 if ((beforeApkSigningBlock.size() % ANDROID_COMMON_PAGE_ALIGNMENT_BYTES != 0)) { in verifyIntegrity()
169 beforeApkSigningBlock.size()); in verifyIntegrity()
173 long signingBlockSize = centralDirOffset - beforeApkSigningBlock.size(); in verifyIntegrity()
301 getChunkCount(input.size(), CONTENT_DIGESTED_CHUNK_MAX_SIZE_BYTES); in computeOneMbChunkContentDigests()
309 digestAlgorithms.toArray(new ContentDigestAlgorithm[digestAlgorithms.size()]); in computeOneMbChunkContentDigests()
343 long inputRemaining = input.size(); in computeOneMbChunkContentDigests()
395 getChunkCount(input.size(), CONTENT_DIGESTED_CHUNK_MAX_SIZE_BYTES); in computeOneMbChunkContentDigests()
402 List<ChunkDigests> chunkDigestsList = new ArrayList<>(digestAlgorithms.size()); in computeOneMbChunkContentDigests()
456 messageDigests = new ArrayList<>(chunkDigests.size()); in ChunkDigester()
[all …]
/tools/apksig/src/main/java/com/android/apksig/internal/apk/v4/
DV4Signature.java55 final int size = 4/*hashAlgorithm*/ + 1/*log2BlockSize*/ + bytesSize(this.salt) in toByteArray() local
57 ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); in toByteArray()
97 final int size = bytesSize(this.apkDigest) + bytesSize(this.certificate) + bytesSize( in toByteArray() local
100 ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); in toByteArray()
138 final int size = in getSignedData() local
143 ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); in getSignedData()
144 buffer.putInt(size); in getSignedData()
186 final int size = readIntLE(stream); in readBytes() local
187 final byte[] bytes = new byte[size]; in readBytes()
199 final int size = buffer.getInt(); in readBytes() local
[all …]
/tools/apksig/src/main/java/com/android/apksig/util/
DDataSource.java58 long size(); in size() method
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/external/fat32lib/src/main/java/de/waldheinz/fs/fat/
DSuperFloppyFormatter.java376 static private int sectorsPerCluster32FromSize(long size, int sectorSize) { in sectorsPerCluster32FromSize() argument
377 final long sectors = size / sectorSize; in sectorsPerCluster32FromSize()
406 static private int sectorsPerCluster16FromSize(long size, int sectorSize) { in sectorsPerCluster16FromSize() argument
407 final long sectors = size / sectorSize; in sectorsPerCluster16FromSize()
430 long size = device.getSize(); in sectorsPerCluster16() local
432 return sectorsPerCluster16FromSize(size, sectorSize); in sectorsPerCluster16()
436 long size = device.getSize(); in defaultSectorsPerCluster() local
441 return sectorsPerCluster12(size, sectorSize); in defaultSectorsPerCluster()
454 static private int sectorsPerCluster12(long size, int sectorSize) { in sectorsPerCluster12() argument
457 final long sectors = size / sectorSize; in sectorsPerCluster12()
[all …]
/tools/apksig/src/main/java/com/android/apksig/
DHints.java54 final long size; field in Hints.PatternWithRange
59 this.size = Long.MAX_VALUE; in PatternWithRange()
62 public PatternWithRange(String pattern, long offset, long size) { in PatternWithRange() argument
65 this.size = size; in PatternWithRange()
78 this.size); in ClampToAbsoluteByteRange()
89 ByteArrayOutputStream bos = new ByteArrayOutputStream(pinByteRanges.size() * 8); in encodeByteRangeList()

12345678