MCPcopy Create free account
hub / github.com/L-JINBIN/ApkDataMultiplexing / align

Method align

src/bin/zip/ZipMaker.java:384–391  ·  view source on GitHub ↗
(int alignment, byte[] extra, long extraDataOffset)

Source from the content-addressed store, hash-verified

382 }
383
384 private byte[] align(int alignment, byte[] extra, long extraDataOffset) throws IOException {
385 if (isAligned(extraDataOffset + extra.length, alignment)) {
386 return extra;
387 }
388 extra = ExtraDataRecord.trim(extra);
389 int padding = getAlignedPadding(extraDataOffset + extra.length, alignment);
390 return Arrays.copyOf(extra, extra.length + padding);
391 }
392
393 private static boolean isAligned(long pos, int alignTo) {
394 return (pos % alignTo) == 0;

Callers 1

writeHeaderMethod · 0.95

Calls 3

isAlignedMethod · 0.95
trimMethod · 0.95
getAlignedPaddingMethod · 0.95

Tested by

no test coverage detected