public static byte[] stringToGsm7BitPackedWithHeader(String data,byte[] header,int languageTable,int languageShiftTable) throws EncodeException {
  if (header == null || header.length == 0) {
    return stringToGsm7BitPacked(data,languageTable,languageShiftTable);
  }
  int headerBits=(header.length + 1) * 8;
  int headerSeptets=(headerBits + 6) / 7;
  byte[] ret=stringToGsm7BitPacked(data,headerSeptets,true,languageTable,languageShiftTable);
  ret[1]=(byte)header.length;
  System.arraycopy(header,0,ret,2,header.length);
  return ret;
}

public static byte [ ] stringToGsm7BitPackedWithHeader ( String data , byte [ ] header , int languageTable , int languageShiftTable ) throws EncodeException { if ( header == null || header . length == 0 ) { return stringToGsm7BitPacked ( data , languageTable , languageShiftTable ) ; } int headerBits = ( header . length + 1 ) * 8 ; int headerSeptets = ( headerBits + 6 ) / 7 ; byte [ ] ret = stringToGsm7BitPacked ( data , headerSeptets , true , languageTable , languageShiftTable ) ; ret [ 1 ] = ( byte ) header . length ; System . arraycopy ( header , 0 , ret , 2 , header . length ) ; return ret ; }
converts a string into a byte array containing the 7 - bit packed gsm alphabet representation of the string . if a header is provided , this is included in the returned byte array and padded to a septet boundary . < p / > unencodable chars are encoded as spaces < p / > byte 0 in the returned byte array is the count of septets used , including the header and header padding . the returned byte array is the minimum size required to store the packed septets . the returned array cannot contain more than 255 septets .
