
net.interfax.rest.client.util.ArrayUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
Library that enables using InterFAX HTTP APIs using Java
package net.interfax.rest.client.util;
public class ArrayUtil {
public static byte[][] chunkArray(byte[] array, int chunkSize) {
int numOfChunks = (int)Math.ceil((double)array.length / chunkSize);
byte[][] output = new byte[numOfChunks][];
for(int i = 0; i < numOfChunks; ++i) {
int start = i * chunkSize;
int length = Math.min(array.length - start, chunkSize);
byte[] temp = new byte[length];
System.arraycopy(array, start, temp, 0, length);
output[i] = temp;
}
return output;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy