Interface LineLevelAppender
-
- All Superinterfaces:
java.lang.AutoCloseable
,java.io.Closeable
,LineDataConsumer
public interface LineLevelAppender extends LineDataConsumer, java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description static LineLevelAppender
EMPTY
static int
TYPICAL_LINE_LENGTH
A typical line length used in many textual standards-
Fields inherited from interface org.apache.sshd.common.util.io.LineDataConsumer
FAIL, IGNORE
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
consume(java.lang.CharSequence lineData)
boolean
isWriteEnabled()
static LineLevelAppender
wrap(java.lang.Appendable appendable)
static LineLevelAppender
wrap(java.lang.Appendable appendable, java.util.function.BooleanSupplier writeEnabled)
void
writeLineData(java.lang.CharSequence lineData)
Called by the implementation once end-of-line is detected.
-
-
-
Field Detail
-
TYPICAL_LINE_LENGTH
static final int TYPICAL_LINE_LENGTH
A typical line length used in many textual standards- See Also:
- Constant Field Values
-
EMPTY
static final LineLevelAppender EMPTY
-
-
Method Detail
-
isWriteEnabled
boolean isWriteEnabled()
- Returns:
true
if OK to accumulate data in work buffer
-
consume
default void consume(java.lang.CharSequence lineData) throws java.io.IOException
- Specified by:
consume
in interfaceLineDataConsumer
- Throws:
java.io.IOException
-
writeLineData
void writeLineData(java.lang.CharSequence lineData) throws java.io.IOException
Called by the implementation once end-of-line is detected.- Parameters:
lineData
- The "pure" line data - excluding any CR/LF(s).- Throws:
java.io.IOException
- If failed to write the data
-
wrap
static LineLevelAppender wrap(java.lang.Appendable appendable)
-
wrap
static LineLevelAppender wrap(java.lang.Appendable appendable, java.util.function.BooleanSupplier writeEnabled)
-
-