MCPcopy Create free account
hub / github.com/diffplug/matfilerw / getPadding

Method getPadding

src/main/java/com/jmatio/io/MatTag.java:31–43  ·  view source on GitHub ↗

Calculate padding

(int size, boolean compressed)

Source from the content-addressed store, hash-verified

29 * Calculate padding
30 */
31 protected int getPadding(int size, boolean compressed) {
32 int padding;
33 //data not packed in the tag
34 if (!compressed) {
35 int b;
36 padding = (b = (((size / sizeOf()) % (8 / sizeOf())) * sizeOf())) != 0 ? 8 - b : 0;
37 } else //data _packed_ in the tag (compressed)
38 {
39 int b;
40 padding = (b = (((size / sizeOf()) % (4 / sizeOf())) * sizeOf())) != 0 ? 4 - b : 0;
41 }
42 return padding;
43 }
44
45 /* (non-Javadoc)
46 * @see java.lang.Object#toString()

Callers 2

writeToMethod · 0.80
ISMatTagMethod · 0.80

Calls 1

sizeOfMethod · 0.95

Tested by

no test coverage detected