void packLanguageOrRegion(final String in, final byte base,
      final byte[] out) {
    if (in == null) {
      out[0] = 0;
      out[1] = 0;
    } else if (in.length() < 3 || in.charAt(2) == 0 || in.charAt(2) == '-') {
      out[0] = (byte) in.charAt(0);
      out[1] = (byte) in.charAt(1);
    } else {
      byte first = (byte) ((in.charAt(0) - base) & 0x007f);
      byte second = (byte) ((in.charAt(1) - base) & 0x007f);
      byte third = (byte) ((in.charAt(2) - base) & 0x007f);

      out[0] = (byte) (0x80 | (third << 2) | (second >> 3));
      out[1] = (byte) ((second << 5) | first);
    }
  }
void packLanguageOrRegion(final String in, final byte base,
      final byte[] out) {
    if (in == null) {
      out[0] = 0;
      out[1] = 0;
    } else if (in.length() < 3 || in.charAt(2) == 0 || in.charAt(2) == '-') {
      out[0] = (byte) in.charAt(0);
      out[1] = (byte) in.charAt(1);
    } else {
      byte first = (byte) ((in.charAt(0) - base) & 0x007f);
      byte second = (byte) ((in.charAt(1) - base) & 0x007f);
      byte third = (byte) ((in.charAt(2) - base) & 0x007f);

      out[0] = (byte) (0x80 | (third << 2) | (second >> 3));
      out[1] = (byte) ((second << 5) | first);
    }
  }
void packLanguageOrRegion ( final String in , final byte base , final byte [ ] out ) { if ( in == null ) { out [ 0 ] = 0 ; out [ 1 ] = 0 ; } else if ( in . length ( ) < 3 || in . charAt ( 2 ) == 0 || in . charAt ( 2 ) == ' ' ) { out [ 0 ] = ( byte ) in . charAt ( 0 ) ; out [ 1 ] = ( byte ) in . charAt ( 1 ) ; } else { byte first = ( byte ) ( ( in . charAt ( 0 ) - base ) & 0x007f ) ; byte second = ( byte ) ( ( in . charAt ( 1 ) - base ) & 0x007f ) ; byte third = ( byte ) ( ( in . charAt ( 2 ) - base ) & 0x007f ) ; out [ 0 ] = ( byte ) ( 0x80 | ( third << 2 ) | ( second >> 3 ) ) ; out [ 1 ] = ( byte ) ( ( second << 5 ) | first ) ; } }
/* static
/ * static