public static int numChunksForMessage ( NDArrayMessage message , int chunkSize ) { int sizeOfMessage = NDArrayMessage . byteBufferSizeForMessage ( message ) ; int numMessages = sizeOfMessage / chunkSize ; //increase by 1 for padding if ( numMessages * chunkSize < sizeOfMessage ) numMessages ++ ; return numMessages ; }
Determine the number of chunks