Class BoundedBufferedReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
com.aowagie.text.pdf.BoundedBufferedReader
- All Implemented Interfaces:
Closeable, AutoCloseable, Readable
The BoundedBufferedReader class.
A BufferedReader that prevents DoS attacks by providing bounds for line length and number of lines.
Copyright (c) 2011 - Sean Malone.
The BoundedBufferedReader is published by Sean Malone under the BSD license. You should read and accept the
LICENSE before you use, modify, and/or redistribute this software.
- Version:
- 1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate static final intprivate static final intprivate final intprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionBoundedBufferedReader(Reader reader) Crea un BufferedReader con límites de lectura por defecto.BoundedBufferedReader(Reader reader, int maxLines, int maxLineLen) Crea un BufferedReader con límites de lectura. -
Method Summary
Methods inherited from class BufferedReader
close, lines, mark, markSupported, read, read, ready, reset, skipMethods inherited from class Reader
nullReader, of, read, read, readAllAsString, readAllLines, transferTo
-
Field Details
-
DEFAULT_MAX_LINES
private static final int DEFAULT_MAX_LINES- See Also:
-
DEFAULT_MAX_LINE_LENGTH
private static final int DEFAULT_MAX_LINE_LENGTH- See Also:
-
readerMaxLines
private final int readerMaxLines -
readerMaxLineLen
private final int readerMaxLineLen -
currentLine
private int currentLine
-
-
Constructor Details
-
BoundedBufferedReader
Crea un BufferedReader con límites de lectura.- Parameters:
reader- Lector subyacente.maxLines- Número máximo de líneas que permitimos leer.maxLineLen- Número máximo de octetos por línea que permitimos leer.
-
BoundedBufferedReader
Crea un BufferedReader con límites de lectura por defecto.- Parameters:
reader- Lector subyacente.
-
-
Method Details
-
readLine
- Overrides:
readLinein classBufferedReader- Throws:
IOException
-