code: @Override
      public int writeObjectBegin(String type)
          throws IOException
      {
          int newRef = _classRefs.size();
          int ref = _classRefs.put(type, newRef, false);
  
          if (newRef != ref) {
              if (SIZE < _offset + 32)
                  flushBuffer();
  
              if (ref <= OBJECT_DIRECT_MAX) {
                  _buffer[_offset++] = (byte) (BC_OBJECT_DIRECT + ref);
              }
              else {
                  _buffer[_offset++] = (byte) 'O';
                  writeInt(ref);
              }
  
              return ref;
          }
          else {
              if (SIZE < _offset + 32)
                  flushBuffer();
  
              _buffer[_offset++] = (byte) 'C';
  
              writeString(type);
  
              return -1;
          }
      }
docs: Writes the object definition
  
  <code><pre>
  C &lt;string> &lt;int> &lt;string>*
  </pre></code>