code: private void writeType(String type)
          throws IOException
      {
          flushIfFull();
  
          int len = type.length();
          if (len == 0) {
              throw new IllegalArgumentException("empty type is not allowed");
          }
  
          if (_typeRefs == null)
              _typeRefs = new HashMap<String, Integer>();
  
          Integer typeRefV = (Integer) _typeRefs.get(type);
  
          if (typeRefV != null) {
              int typeRef = typeRefV.intValue();
  
              writeInt(typeRef);
          }
          else {
              _typeRefs.put(type, Integer.valueOf(_typeRefs.size()));
  
              writeString(type);
          }
      }
docs: <code><pre>
  type ::= string
  ::= int
  </code></pre>