public long getEncodedLength ( final byte [ ] pArray ) { // Calculate non-chunked size - rounded up to allow for padding // cast to long is needed to avoid possibility of overflow long len = ( ( pArray . length + unencodedBlockSize - 1 ) / unencodedBlockSize ) * ( long ) encodedBlockSize ; if ( lineLength > 0 ) { // We're using chunking // Round up to nearest multiple len += ( ( len + lineLength - 1 ) / lineLength ) * chunkSeparatorLength ; } return len ; }
Calculates the amount of space needed to encode the supplied array .