FileDocCategorySizeDatePackage
Parser.javaAPI DocJMF 2.1.1e2646Mon May 12 12:20:54 BST 2003com.sun.media.rtsp.protocol

Parser

public class Parser extends Object

Fields Summary
private Vector
buffer
Constructors Summary
public Parser()

        init();
    
Methods Summary
public byte[]getContent(java.io.ByteArrayInputStream bin)

        ByteArrayOutputStream bout = new ByteArrayOutputStream();

        skipWhitespace(bin);

        int ch = readChar(bin);

        while (ch != -1) {
            bout.write(ch);

            ch = readChar(bin);
        }

        return bout.toByteArray();
    
public java.lang.StringgetLine(java.io.ByteArrayInputStream bin)

        ByteArrayOutputStream bout = new ByteArrayOutputStream();

        int ch = readChar(bin);

        while (ch != '\n" && ch != '\r" && ch != -1) {
            bout.write(ch);

            ch = readChar(bin);
        }

        ch = readChar(bin);

        if (ch != '\n") {
            ungetChar(ch);
        }

        String line = new String(bout.toByteArray());

        return line;
    
public java.lang.StringgetStringToken(java.io.ByteArrayInputStream bin)

        ByteArrayOutputStream bout = new ByteArrayOutputStream();

        skipWhitespace(bin);

        int ch = readChar(bin);

        while (ch != '\n" && ch != '\r" && ch != -1) {
            bout.write(ch);

            ch = readChar(bin);
        }

        String token = new String(bout.toByteArray());

        return token;
    
public java.lang.StringgetToken(java.io.ByteArrayInputStream bin)

        ByteArrayOutputStream bout = new ByteArrayOutputStream();

        skipWhitespace(bin);

        if (bin.available() > 0) {
            int ch = readChar(bin);

            while (ch != ' " && ch != '\n" && ch != '\r" && ch != -1) {
                bout.write(ch);

                ch = readChar(bin);
            }

            ungetChar(ch);
        }

        String token = new String(bout.toByteArray());

        return token;
    
private voidinit()

        buffer = new Vector();
    
public intreadChar(java.io.ByteArrayInputStream bin)

        int ch;

        if (buffer.size() > 0) {
            ch = ((Integer) buffer.elementAt(0)).intValue();

            buffer.removeElementAt(0);
        } else {
            ch = bin.read();
        }

        return ch;
    
private voidskipWhitespace(java.io.ByteArrayInputStream bin)

        int ch = readChar(bin);

        while (ch == ' " || ch == '\n" || ch == '\r") {
            ch = readChar(bin);
        }

        ungetChar(ch);
    
public voidungetChar(int ch)

        buffer.insertElementAt(new Integer(ch), 0);