TODO: msgsize muss angepasst werden
963906
@Override
    public String incomingCrypted(String st, HBCIMsgStatus msgStatus, String msgName) {
        int idx = st.indexOf("'");
        if (idx != -1) {
            try {
                String msghead_st = st.substring(0, idx);
                int plusidx = 0;
                for (int i = 0; i < 5; i++)
                    plusidx = msghead_st.indexOf("+", plusidx + 1);
                if (plusidx == -1) {
                    log.warn("MsgRef is missing, adding it");
                    String[] des = {"dialogid", "msgnum"};
                    for (int i = 0; i < 2; i++) {
                        String temp = (msgStatus.getData().get("orig_" + msgName + ".MsgHead." + des[i]));
                        log.warn("setting MsgRef." + des[i] + " to " + temp);
                        msghead_st += (i == 0 ? "+" : ":");
                        msghead_st += temp;
                    }
                    st = new StringBuffer(st).replace(0, idx, msghead_st).toString();
                }
            } catch (Exception ex) {
                throw new HBCI_Exception("*** error while fixing missing MsgRef", ex);
            }
        }
        return st;
    }
604024
@Override
    public final synchronized TerminalSize getTerminalSize() throws IOException {
        TerminalSize size = findTerminalSize();
        onResized(size);
        return size;
    }
514929
public long totalSize() {
        long retval=0;
        for(int i=0; i < index; i++)
            retval+=total_size_visitor.applyAsLong(messages[i], this);
        return retval;
    }
1344259
protected function getSingleWeighting()
	{
	    $arrPrio = array();
	    $arrPrioW = array();
	    $arrWeights = array_flip($this->arrAllBannersBasic);

	    //welche Wichtungen gibt es?
	    if (array_key_exists(1, $arrWeights)) { $arrPrioW[1] = 1; };
	    if (array_key_exists(2, $arrWeights)) { $arrPrioW[2] = 2; };
	    if (array_key_exists(3, $arrWeights)) { $arrPrioW[3] = 3; };
	    
	    $arrPrio[0] = array('start'=>0,  'stop'=>0);
	    $arrPrio[1] = array('start'=>1,  'stop'=>90);
	    $arrPrio[2] = array('start'=>91, 'stop'=>150);
	    $arrPrio[3] = array('start'=>151,'stop'=>180);
	    if ( !array_key_exists(2, $arrPrioW) )
	    {
	        // no prio 2 banner
	        $arrPrio[2] = array('start'=>0,  'stop'=>0);
	        $arrPrio[3] = array('start'=>91, 'stop'=>120);
	    }
	    $intPrio1 = (count($arrPrioW)) ? min($arrPrioW) : 0 ;
	    $intPrio2 = (count($arrPrioW)) ? max($arrPrioW) : 0 ;
	    
	    //wenn Wichtung vorhanden, dann per Zufall eine auswählen
	    if ($intPrio1>0)
	    {
	        $intWeightingHigh = mt_rand($arrPrio[$intPrio1]['start'],$arrPrio[$intPrio2]['stop']);
	    
	        // 1-180 auf 1-3 umrechnen
	        if ($intWeightingHigh<=$arrPrio[3]['stop'])
	        {
	            $intWeighting=3;
	        }
	        if ($intWeightingHigh<=$arrPrio[2]['stop'])
	        {
	            $intWeighting=2;
	        }
	        if ($intWeightingHigh<=$arrPrio[1]['stop'])
	        {
	            $intWeighting=1;
	        }
	    }
	    else
	    {
	        $intWeighting=0;
	    }
	    return $intWeighting;
	}
17010
function(event, args) {
      var size = args[0];
		// TODO: do not hardcode those sizes !!
      WireIt.sn(this.bodyEl, null, {width: (size[0]-14)+"px", height: (size[1]-( this.ddHandle ? 44 : 14) )+"px"});
   }
993373
function generateSizeParam(sizes) {
  return sizes.map(size => size.join(DIMENSION_SEPARATOR)).join(SIZE_SEPARATOR);
}
246400
@Nonnegative
  public long getSize ()
  {
    if (m_nSize >= 0)
      return m_nSize;
    if (m_aCachedContent != null)
      return m_aCachedContent.length;
    if (m_aDFOS.isInMemory ())
      return m_aDFOS.getDataLength ();
    return m_aDFOS.getFile ().length ();
  }
428472
public int add(final Message msg, boolean resize) {
        if(msg == null) return 0;
        if(index >= messages.length) {
            if(!resize)
                return 0;
            resize();
        }
        messages[index++]=msg;
        return 1;
    }
1183287
function rel2absSeg(jPath,ind) {
        
        var seg = jPath.getSeg(ind),
        letter = seg.pathSegTypeAsLetter.toLowerCase(),
        args,ref;
        
        if (seg.pathSegTypeAsLetter !== letter) return; //déjà en absolu
        
        args = [ind,letter.toUpperCase()];
        ref = jPath.getCurPt(ind);
        
        if (letter === 'h') args.push(ref.x+seg.x);
        else if (letter === 'v') args.push(ref.y+seg.y);
        else if (letter === "m") args.push(seg.x,seg.y);
        else if (letter !== "z") {
            
            args.push(ref.x+seg.x,ref.y+seg.y);
            
            switch (letter) {
                case 'c' : args.push(ref.x+seg.x1,ref.y+seg.y1,ref.x+seg.x2,ref.y+seg.y2); break;
                case 'q' : args.push(ref.x+seg.x1,ref.y+seg.y1); break;
                case 'a' : args.push(seg.r1,seg.r2,seg.angle,seg.largArcFlag,seg.sweepFlag); break;
                case 's' : args.push(ref.x+seg.x2,ref.y+seg.y2); break;
            }
        }
        
        jPath.replaceSeg.apply(jPath,args);
    }
1007311
protected int marshalMessagesToSameDestination(Address dest, Message[] buf, final int start_index, final int end_index,
                                                   int max_bundle_size) throws Exception {
        int num_msgs=0, bytes=0;
        for(int i=start_index; i != end_index; i=increment(i)) {
            Message msg=buf[i];
            if(msg != null && msg != NULL_MSG && Objects.equals(dest, msg.dest())) {
                long msg_size=msg.size();
                if(bytes + msg_size > max_bundle_size)
                    break;
                bytes+=msg_size;
                num_msgs++;
                buf[i]=NULL_MSG;
                msg.writeToNoAddrs(msg.src(), output, transport.getId());
            }
        }
        return num_msgs;
    }
933176
@Override
    public SegmentationMessage createSGM() {
        SegmentationMessage msg = new SegmentationMessageImpl(_SGM_HOLDER.mandatoryCodes,
                _SGM_HOLDER.mandatoryVariableCodes, _SGM_HOLDER.optionalCodes, _SGM_HOLDER.mandatoryCodeToIndex,
                _SGM_HOLDER.mandatoryVariableCodeToIndex, _SGM_HOLDER.optionalCodeToIndex);
        return msg;
    }
1087244
private MessageDigest getMessageDigest(Algorithms algorithms) {
        try {
            return MessageDigest.getInstance(algorithms.getAlgorithms());
        } catch (NoSuchAlgorithmException exception) {
            throw new SecureException("当前系统没有指定的算法提供者:[" + "" + "]", exception);
        }
    }
768266
private static long computeMsgId(MsgNode msgNode) {
    return SoyMsgIdComputer.computeMsgId(
        buildMsgParts(msgNode), msgNode.getMeaning(), msgNode.getContentType());
  }
430242
function() {
        var ctx = u.context(TINY);
        logger.debugf('Invoke size(msgId=%d)', ctx.id);
        return futureDecodeOnly(ctx, 0x29, p.decodeVInt);
      }
522754
private static function checkSize(Meta $m)
    {
        if ($m->getSize()) {
            $length = strlen($m->getValue());
            if ($m->getType() === "varchar" && $length > $m->getSize())
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "char" && $length > 1)
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "tinytext" && ($length > 255 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "text" && ($length > 65535 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "mediumtext" && ($length > 16777215 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "longtext" && ($length > 4294967295 || $length > $m->getSize()))
                $m->setError("tamanho máximo de caracteres excedido. Max {$m->getSize()}");

            elseif ($m->getType() === "tinyint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(8)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "smallint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(16)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "mediumint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(24)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "int" && !in_array($m->getKey(), ["extend", "extend_add", "list", "list_mult", "selecao", "selecao_mult", "checkbox_rel", "extend_mult", "checkbox_mult"]) && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(32)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));

            elseif ($m->getType() === "bigint" && ($m->getValue() > self::intLength($m->getSize()) || $m->getValue() > self::intLength(64)))
                $m->setError("numero excedeu seu limite. Max " . self::intLength($m->getSize()));
        }
    }
1327455
@Override
    public String getFormattedMessage() {
        final StringBuilder sb = getBuffer();
        formatTo(sb);
        final String result = sb.toString();
        StringBuilders.trimToMaxSize(sb, Constants.MAX_REUSABLE_MESSAGE_SIZE);
        return result;
    }
1178264
private static String badIndexMsg(int index, int size, String desc, Object... params) {
		if (index < 0) {
			return StrUtil.format("{} ({}) must not be negative", StrUtil.format(desc, params), index);
		} else if (size < 0) {
			throw new IllegalArgumentException("negative size: " + size);
		} else { // index >= size
			return StrUtil.format("{} ({}) must be less than size ({})", StrUtil.format(desc, params), index, size);
		}
	}