public static String networkNameToString(byte[] data,int offset,int length){
  String ret;
  if ((data[offset] & 0x80) != 0x80 || length < 1) {
    return "";
  }
switch ((data[offset] >>> 4) & 0x7) {
case 0:
    int countSeptets;
  int unusedBits=data[offset] & 7;
countSeptets=(((length - 1) * 8) - unusedBits) / 7;
ret=GsmAlphabet.gsm7BitPackedToString(data,offset + 1,countSeptets);
break;
case 1:
try {
ret=new String(data,offset + 1,length - 1,"utf-16");
}
 catch (UnsupportedEncodingException ex) {
ret="";
Log.e(LOG_TAG,"implausible UnsupportedEncodingException",ex);
}
break;
default :
ret="";
break;
}
if ((data[offset] & 0x40) != 0) {
}
return ret;
}

public static String networkNameToString ( byte [ ] data , int offset , int length ) { String ret ; if ( ( data [ offset ] & 0x80 ) != 0x80 || length < 1 ) { return "" ; } switch ( ( data [ offset ] > > > 4 ) & 0x7 ) { case 0 : int countSeptets ; int unusedBits = data [ offset ] & 7 ; countSeptets = ( ( ( length - 1 ) * 8 ) - unusedBits ) / 7 ; ret = GsmAlphabet . gsm7BitPackedToString ( data , offset + 1 , countSeptets ) ; break ; case 1 : try { ret = new String ( data , offset + 1 , length - 1 , "utf-16" ) ; } catch ( UnsupportedEncodingException ex ) { ret = "" ; Log . e ( LOG_TAG , "implausible UnsupportedEncodingException" , ex ) ; } break ; default : ret = "" ; break ; } if ( ( data [ offset ] & 0x40 ) != 0 ) { } return ret ; }
convert a ts 24 . 008 section 10 . 5 . 3 . 5a network name field to a string " offset " points to " octet 3 " , the coding scheme byte empty string returned on decode error
