Package net.targetr.wtm3.io
Class MetadataReader
java.lang.Object
net.targetr.wtm3.io.MetadataReader
Reads HTTP metadata through CRLF-CRLF and pushes back any over-read body bytes.
Enforces the configured metadata buffer size and checks elapsed time between reads.
- Author:
- Dr Michael Gardiner
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringReads from an input stream until a standard metadata boundary is reached.
-
Method Details
-
readMeta
Reads from an input stream until a standard metadata boundary is reached.- Parameters:
in- input with pushback capacity at leastSettings.metadataReadBufferSize- Returns:
- US-ASCII metadata including its terminator, with leading whitespace removed
- Throws:
IOException- If there is a problem reading from the stream.IllegalArgumentException- if the metadata exceeds the configured buffer size
-