Initialized the internals from a new chunk

@param content
the new received chunk
@throws ErrorDataDecoderException
if there is a problem with the charset decoding or other
errors
962570
@Override
    public HttpPostStandardRequestDecoder offer(HttpContent content) {
        checkDestroyed();

        // Maybe we should better not copy here for performance reasons but this will need
        // more care by the caller to release the content in a correct manner later
        // So maybe something to optimize on a later stage
        ByteBuf buf = content.content();
        if (undecodedChunk == null) {
            undecodedChunk = buf.copy();
        } else {
            undecodedChunk.writeBytes(buf);
        }
        if (content instanceof LastHttpContent) {
            isLastChunk = true;
        }
        parseBody();
        if (undecodedChunk != null && undecodedChunk.writerIndex() > discardThreshold) {
            undecodedChunk.discardReadBytes();
        }
        return this;
    }
1278503
@PostConstruct
  public void init()
    throws Exception
  {
    if (_encoding == null)
      throw new ConfigException(L.l("character-encoding requires a 'value' attribute with the character encoding."));

    _localEncoding.set(_encoding);
  }
232120
@Override
    public void handleProcessingInstruction(
            final char[] buffer,
            final int targetOffset, final int targetLen, final int targetLine, final int targetCol,
            final int contentOffset, final int contentLen, final int contentLine, final int contentCol,
            final int outerOffset, final int outerLen, final int line, final int col)
            throws ParseException {

        this.someSelectorsMatch = false;
        for (int i = 0; i < this.selectorsLen; i++) {

            this.selectorMatches[i] =
                    this.selectorFilters[i].matchProcessingInstruction(false, this.markupLevel, this.markupBlocks[this.markupLevel]);
            if (this.selectorMatches[i]) {
                this.someSelectorsMatch = true;
            }

        }

        if (this.someSelectorsMatch) {
            markCurrentSelection();
            this.selectedHandler.handleProcessingInstruction(
                    buffer,
                    targetOffset, targetLen, targetLine, targetCol,
                    contentOffset, contentLen, contentLine, contentCol,
                    outerOffset, outerLen, line, col);
            unmarkCurrentSelection();
            return;
        }

        unmarkCurrentSelection();
        this.nonSelectedHandler.handleProcessingInstruction(
                buffer,
                targetOffset, targetLen, targetLine, targetCol,
                contentOffset, contentLen, contentLine, contentCol,
                outerOffset, outerLen, line, col);

    }
962153
@Override
    public void processOtherContent(Wrapper<Content> content) {
        if (processFirstOtherContent) {
            builder.append(baseIndent).append("otherContentList=").append("\n");
            processFirstOtherContent = false;
        }
        builder.append(content.toString(baseIndent)).append("\n");
    }
1347636
private void initData(String x, int minsize, int maxsize) {
        content = null;
        setContent(x, minsize, maxsize);
    }
294554
public static void init(String templateDir, String charset, Map<String, Object> initedGlobalContext) {
		globalContext.putAll(initedGlobalContext);
		init(templateDir, charset);
	}
575319
public void initialize(Server server) {
        serverFailureCounts = new MeasuredRate(failureCountSlidingWindowInterval);
        requestCountInWindow = new MeasuredRate(300000L);
        if (publisher == null) {
            dataDist = new DataDistribution(getBufferSize(), PERCENTS);
            publisher = new DataPublisher(dataDist, getPublishIntervalMillis());
            publisher.start();
        }
        this.server = server;
    }
1251909
public static void decodeTo(String content, MultiMap<String> map, String charset) {
        decodeTo(content, map, charset == null ? null : Charset.forName(charset));
    }
530390
protected void parse( String content ) {
        Tokenizer tokenizer = new CndTokenizer(false, true);
        TokenStream tokens = new TokenStream(content, tokenizer, false);
        tokens.start();
        while (tokens.hasNext()) {
            // Keep reading while we can recognize one of the two types of statements ...
            if (tokens.matches("<", ANY_VALUE, "=", ANY_VALUE, ">")) {
                parseNamespaceMapping(tokens);
            } else if (tokens.matches("[", ANY_VALUE, "]")) {
                parseNodeTypeDefinition(tokens);
            } else {
                Position position = tokens.previousPosition();
                throw new ParsingException(position, CndI18n.expectedNamespaceOrNodeDefinition.text(tokens.consume(),
                                                                                                    position.getLine(),
                                                                                                    position.getColumn()));
            }
        }
    }
1200028
public final void setContent(byte[] content)
    {
        //clear non relevant flags
        this.contentString=null;
        this.contentParts=null;
        this.contentType=ContentType.BINARY;

        if(content==null)
        {
            this.contentBinary=null;
        }
        else
        {
            this.contentBinary=content.clone();
        }
    }
1099231
@SuppressWarnings("resource")
	private void initializeContentBuffer() throws IOException {
		this.tempFile = File.createTempFile("shapeWriter", ".sh_");  //$NON-NLS-1$//$NON-NLS-2$
		this.tempFile.deleteOnExit();
		this.tempStream = Channels.newChannel(new FileOutputStream(this.tempFile));
		this.buffer = ByteBuffer.allocate(BLOCK_SIZE);
		this.bufferPosition = 0;
	}
902561
private void parseContent() throws Exception {
        char c;

        while (true) {
            // consume characters (or ignorable whitspace) until delimiter
            parseCharData();

            // Handle delimiters
            c = readCh();
            switch (c) {
                case '&': // Found "&"
                    c = readCh();
                    if (c == '#') {
                        parseCharRef();
                    } else {
                        unread(c);
                        parseEntityRef(true);
                    }
                    isDirtyCurrentElement = true;
                    break;

                case '<': // Found "<"
                    dataBufferFlush();
                    c = readCh();
                    switch (c) {
                        case '!': // Found "<!"
                            c = readCh();
                            switch (c) {
                                case '-': // Found "<!-"
                                    require('-');
                                    isDirtyCurrentElement = false;
                                    parseComment();
                                    break;
                                case '[': // Found "<!["
                                    isDirtyCurrentElement = false;
                                    require("CDATA[");
                                    handler.startCDATA();
                                    inCDATA = true;
                                    parseCDSect();
                                    inCDATA = false;
                                    handler.endCDATA();
                                    break;
                                default:
                                    fatal("expected comment or CDATA section",
                                            c, null);
                                    break;
                            }
                            break;

                        case '?': // Found "<?"
                            isDirtyCurrentElement = false;
                            parsePI();
                            break;

                        case '/': // Found "</"
                            isDirtyCurrentElement = false;
                            parseETag();
                            return;

                        default: // Found "<" followed by something else
                            isDirtyCurrentElement = false;
                            unread(c);
                            parseElement(false);
                            break;
                    }
            }
        }
    }
542130
protected void initTemplates(Element root, CmsXmlContentDefinition contentDefinition) {

        String strEnabledByDefault = root.attributeValue(ATTR_ENABLED_BY_DEFAULT);
        m_allowedTemplates.setDefaultMembership(safeParseBoolean(strEnabledByDefault, true));
        List<Node> elements = root.selectNodes(APPINFO_TEMPLATE);
        for (Node elem : elements) {
            boolean enabled = safeParseBoolean(((Element)elem).attributeValue(ATTR_ENABLED), true);
            String templateName = elem.getText().trim();
            m_allowedTemplates.setContains(templateName, enabled);
        }
        m_allowedTemplates.freeze();
    }
223396
private static String decodeFormFields(final String content, final Charset charset) {
        if (content == null) {
            return null;
        }

        return urlDecode(content, (charset != null) ? charset : Charsets.UTF_8, true);
    }
157002
public void processingInstruction(String target, String data)
	    throws SAXException {
	if (isAccepted())
	    getContentHandler().processingInstruction(target, data);
    }
890633
public void setContentEncoding(String contentEncoding) throws InvalidArgumentException {
    if (Strings.isNullOrEmpty(contentEncoding)) {
      throw new InvalidArgumentException("empty content encoding");
    }

    this.contentEncoding = contentEncoding;
  }
605153
public static String decode(String content, Charset charset) {
		if (null == charset) {
			charset = CharsetUtil.defaultCharset();
		}
		return decode(content, charset.name());
	}