public byte[] calculatePadding(int paddingLength){
  paddingLength=Math.abs(paddingLength);
  byte[] padding=new byte[paddingLength];
  for (int i=0; i < paddingLength; i++) {
    padding[i]=(byte)(paddingLength - 1);
  }
  return padding;
}

public byte [ ] calculatePadding ( int paddingLength ) { paddingLength = Math . abs ( paddingLength ) ; byte [ ] padding = new byte [ paddingLength ] ; for ( int i = 0 ; i < paddingLength ; i ++ ) { padding [ i ] = ( byte ) ( paddingLength - 1 ) ; } return padding ; }
creates tls padding of a defined length
