Class SingleByteReceiver
- java.lang.Object
-
- org.apache.manifoldcf.connectorcommon.fuzzyml.ByteReceiver
-
- org.apache.manifoldcf.connectorcommon.fuzzyml.SingleByteReceiver
-
- Direct Known Subclasses:
BOMEncodingDetector
public abstract class SingleByteReceiver extends ByteReceiver
This class represents a receiver for a series of single bytes.
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]
byteBuffer
-
Constructor Summary
Constructors Constructor Description SingleByteReceiver(int chunkSize)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
dealWithByte(byte b)
Receive a byte.boolean
dealWithBytes(java.io.InputStream inputStream)
Read a byte stream and process bytes.protected boolean
dealWithRemainder(byte[] buffer, int offset, int len, java.io.InputStream inputStream)
Deal with the remainder of the input.-
Methods inherited from class org.apache.manifoldcf.connectorcommon.fuzzyml.ByteReceiver
finishUp
-
-
-
-
Method Detail
-
dealWithBytes
public final boolean dealWithBytes(java.io.InputStream inputStream) throws java.io.IOException, ManifoldCFException
Read a byte stream and process bytes.- Specified by:
dealWithBytes
in classByteReceiver
- Returns:
- true if abort signalled, false if end of stream reached.
- Throws:
java.io.IOException
ManifoldCFException
-
dealWithByte
public abstract boolean dealWithByte(byte b) throws java.io.IOException, ManifoldCFException
Receive a byte.- Returns:
- true to stop further processing.
- Throws:
java.io.IOException
ManifoldCFException
-
dealWithRemainder
protected boolean dealWithRemainder(byte[] buffer, int offset, int len, java.io.InputStream inputStream) throws java.io.IOException, ManifoldCFException
Deal with the remainder of the input. This is called only when dealWithByte() returns true.- Parameters:
buffer
- is the buffer of characters that should come first.offset
- is the offset within the buffer of the first character.len
- is the number of characters in the buffer.inputStream
- is the stream that should come after the characters in the buffer.- Returns:
- true to abort, false if the end of the stream has been reached.
- Throws:
java.io.IOException
ManifoldCFException
-
-