code: public void putToken(byte [] buf, int off, int len) {
  	if (buf == null || len <=0) {
  	    return;
  	}
  
  	if (logger.isDebugEnabled()) {
  	    logger.debug("put token: " + len);
  	}
  
  	byte[] localBuf = buf;
  	if (off != 0) {
  	    localBuf = new byte[len];
  	    System.arraycopy(buf, off, localBuf, 0, len);
  	}
  
  	synchronized(this) {
  	    if (this.buff == null ||
  		this.buff != null && this.buff.length == this.index) {
  		this.buff = localBuf;
  		this.index = 0;
  	    } else {
  		this.tokens.add(localBuf);
  	    }
  	    notify();
  	}
      }
docs: main function