Class MetadataReader

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

public class MetadataReader extends Object
Reads from an InputStream until all metadata is read.

Most protocols define the end of requests and responses as CR LF CR LF. This class reads a stream until this boundary then returns a String of the contents.

After multiple attempts at more efficient reading, this was chosen for simplicity.

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 - The input stream to read from.
      Returns:
      A string representation of the request.
      Throws:
      IOException - If there is a problem reading from the stream.