FileDocCategorySizeDatePackage
Protocol.javaAPI DocphoneME MR2 API (J2ME)3464Wed May 02 18:00:16 BST 2007com.sun.midp.io.j2me.http

Protocol

public class Protocol extends com.sun.cdc.io.j2me.http.Protocol

Fields Summary
protected int
iStreams
Number of input streams that were opened.
protected int
maxIStreams
Maximum number of open input streams. Set this to zero to prevent openInputStream from giving out a stream in write-only mode.
protected int
oStreams
Number of output streams were opened.
protected int
maxOStreams
Maximum number of output streams. Set this to zero to prevent openOutputStream from giving out a stream in read-only mode.
Constructors Summary
Methods Summary
protected voidcheckMIDPPermission(java.lang.String url)

        //The actual MIDP permission check happens here
    
public java.io.DataInputStreamopenDataInputStream()

        return new DataInputStream(openInputStream());
    
public java.io.DataOutputStreamopenDataOutputStream()

        return new DataOutputStream(openOutputStream());
    
public java.io.InputStreamopenInputStream()


    /*
     * Open the input stream if it has not already been opened.
     * @exception IOException is thrown if it has already been
     * opened.
     */
         
        if (maxIStreams == 0) {
            throw new IOException("no more input streams available");
        }
        InputStream i = super.openInputStream();
        maxIStreams--;
        iStreams++;
        return i;
    
public java.io.OutputStreamopenOutputStream()

        if (maxOStreams == 0) {
            throw new IOException("no more output streams available");
        }
        OutputStream o = super.openDataOutputStream();
        maxOStreams--;
        oStreams++;
        return o;