public ByteStringTranslator(String[] strings){
  if (strings.length > MAXNUM) {
    StringBuilder buf=new StringBuilder();
    for (int i=0; i < strings.length; i++) {
      buf.append("\"" + strings[i] + "\" ");
    }
    throw new IllegalArgumentException("Too many strings for a byte-string translator: \n" + buf.toString() + "("+ strings.length+ " strings)");
  }
  list=new ArrayList<String>(Arrays.asList(strings));
  map=new HashMap<String,Byte>();
  for (int i=0; i < strings.length; i++) {
    map.put(strings[i],(byte)i);
  }
}

public ByteStringTranslator ( String [ ] strings ) { if ( strings . length > MAXNUM ) { StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < strings . length ; i ++ ) { buf . append ( "\"" + strings [ i ] + "\" " ) ; } throw new IllegalArgumentException ( "Too many strings for a byte-string translator: \n" + buf . toString ( ) + "(" + strings . length + " strings)" ) ; } list = new ArrayList < String > ( Arrays . asList ( strings ) ) ; map = new HashMap < String , Byte > ( ) ; for ( int i = 0 ; i < strings . length ; i ++ ) { map . put ( strings [ i ] , ( byte ) i ) ; } }
initialize a byte - string two - way translator , setting byte values according to the position of strings in the array .
