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

Header

public class Header extends Parser

Fields Summary
public int
type
public Object
parameter
public int
contentLength
public static final int
TRANSPORT
public static final int
CSEQ
public static final int
SESSION
public static final int
DURATION
public static final int
RANGE
public static final int
DATE
public static final int
SERVER
public static final int
CONTENT_TYPE
public static final int
CONTENT_BASE
public static final int
CONTENT_LENGTH
Constructors Summary
public Header(String input)


       
        ByteArrayInputStream bin = new ByteArrayInputStream(input.getBytes());

        String id = getToken(bin);

        if (id.equalsIgnoreCase("CSeq:")) {
            type = CSEQ;

            String number = getStringToken(bin).trim();

            parameter = new CSeqHeader(number);
        } else if (id.equalsIgnoreCase("Transport:")) {
            type = TRANSPORT;

            String tx = getToken(bin);

            parameter = new TransportHeader(tx);
        } else if (id.equalsIgnoreCase("Session:")) {
            type = SESSION;

            String tx = getToken(bin);

            parameter = new SessionHeader(tx);
        } else if (id.equalsIgnoreCase("Duration:")) {
            type = DURATION;

            String tx = getToken(bin);

            Debug.println("Duration : " + tx);

            parameter = new DurationHeader(tx);
        } else if (id.equalsIgnoreCase("Range:")) {
            type = RANGE;

            String tx = getToken(bin);

            parameter = new RangeHeader(tx);
        } else if (id.equalsIgnoreCase("Date:")) {
            type = DATE;

            String date = getStringToken(bin);

            // Debug.println( "Date : " + date);
        } else if (id.equalsIgnoreCase("Allow:")) {
            type = DATE;

            String entries = getStringToken(bin);

            // Debug.println( "Allow : " + entries);
        } else if (id.equalsIgnoreCase("Server:")) {
            type = SERVER;

            String server = getStringToken(bin);

            // Debug.println ( "Server   : " + server);
        } else if (id.equalsIgnoreCase("Content-Type:")) {
            type = CONTENT_TYPE;

            String content_type = getStringToken(bin);

            // Debug.println( "Content-Type : " + content_type);
        } else if (id.equalsIgnoreCase("Content-Base:")) {
            type = CONTENT_BASE;
            String content_base = getStringToken(bin);

            parameter = new ContentBaseHeader(content_base);
        } else if (id.equalsIgnoreCase("Content-Length:")) {
            type = CONTENT_LENGTH;

            String content_length = getStringToken(bin);

            // System.out.println( "Content-Length : " + content_length);

            contentLength = new Integer(content_length).intValue();
        } else if (id.equalsIgnoreCase("Last-Modified:")) {
            String date = getStringToken(bin);

            // Debug.println( "Last-Modified: " + date);
        } else if (id.equalsIgnoreCase("RTP-Info:")) {
            String rtpInfo = getStringToken(bin);

            // Debug.println( "RTP-Info: " + rtpInfo);
        } else if (id.length() > 0) {
            Debug.println("unknown id : <" + id + ">");

            String tmp = getStringToken(bin);
        }
    
Methods Summary