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

Response

public class Response extends Parser

Fields Summary
public StatusLine
statusLine
public Vector
headers
public SdpParser
sdp
Constructors Summary
public Response(ByteArrayInputStream bin)

        String line = getLine(bin);

        statusLine = new StatusLine(line);

        headers = new Vector();

        line = getLine(bin);

        int contentLength = 0;

        while (line.length() > 0) {
            if (line.length() > 0) {
                Header header = new Header(line);

                if (header.type == Header.CONTENT_LENGTH) {
                    contentLength = header.contentLength;
                }

                headers.addElement(header);

                line = getLine(bin);
            }
        }

        if (contentLength > 0) {
            byte data[] = new byte[bin.available()];

            try {
                bin.read(data);

                sdp = new SdpParser(data);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    
Methods Summary
public com.sun.media.rtsp.protocol.HeadergetHeader(int type)

        Header header = null;

        for (int i = 0; i < headers.size(); i++) {
            Header tmpHeader = (Header) headers.elementAt(i);

            if (tmpHeader.type == type) {
                header = tmpHeader;

                break;
            }
        }

        return header;
    
public com.sun.media.rtsp.protocol.StatusLinegetStatusLine()

        return statusLine;