Class MetadataReader

java.lang.Object
net.targetr.wtm3.io.MetadataReader

public class MetadataReader extends Object
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 Details

    • readMeta

      public static String readMeta(PushbackInputStream in) throws IOException
      Reads from an input stream until a standard metadata boundary is reached.
      Parameters:
      in - input with pushback capacity at least Settings.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