public interface DetectorStreamProcessorFactory
DetectorStreamProcessors.DetectorStream| Modifier and Type | Method and Description |
|---|---|
DetectorStreamProcessor |
createProcessor()
This method gets a
DetectorStreamProcessor instance managed by this factory. |
int |
getLookaheadCount()
This method determines the required number of bytes a
DetectorStreamProcessor needs as lookahead in order
to make its decisions. |
int getLookaheadCount()
DetectorStreamProcessor needs as lookahead in order
to make its decisions. The DetectorStream will use the maximum required lookahead of
all registered processor-factories. 1024. DetectorStreamProcessor wants to figure out if some file contains the
ASCII-bytes '<?xml' or '<html'. Therefore he requires a lookahead of 5. If he consumes all data until a
'<' is reached (@see ByteIterator.peek()), he can check if 4 more bytes are available. In that
case he can consume all these bytes and make its decision. Otherwise he returns from
DetectorStreamProcessor.process(DetectorStreamBuffer, java.util.Map, boolean) and waits for the next call
that will guarantee the buffer is refilled with at least the specified lookahead. DetectorStreamProcessor createProcessor()
DetectorStreamProcessor instance managed by this factory. Typically the factory will
create a new instance per request. However if a DetectorStreamProcessor is
thread-safe the factory can always return the same instance.DetectorStreamProcessor instance.Copyright © 2001–2016 mmm-Team. All rights reserved.