code: public static int stringToByteCount(String code) {
          @SuppressWarnings("serial")
          HashMap<String, Integer> codingMap = new HashMap<String, Integer>() {
              {
                  put("b", 1);
                  put("byte", 1);
                  put("bool", 1);
                  put("boolean", 1);
                  put("c", 2);
                  put("char", 2);
                  put("character", 2);
                  put("i", 4);
                  put("int", 4);
                  put("integer", 4);
                  put("f", 4);
                  put("float", 4);
                  put("d", 8);
                  put("double", 8);
                  put("l", 8);
                  put("long", 8);
                  put("1", 1);
                  put("2", 2);
                  put("3", 3);
                  put("4", 4);
                  put("5", 5);
                  put("6", 6);
                  put("7", 7);
                  put("8", 8);
              }
          };
          if (codingMap.containsKey(code)) {
              return codingMap.get(code.toLowerCase());
          } else {
              return 0;
          }
      }
docs: The header of could contain characters which are not numbers. Some of them can be translated into bytes. E.g.
  char would be two byte.
  
  @param code
  the code to look for
  @return the size of the given code