javax.microedition.io
Interface ContentConnection

All Superinterfaces:
Connection, InputConnection, OutputConnection, StreamConnection
All Known Subinterfaces:
HttpConnection, HttpsConnection, Operation, HttpServerConnection
All Known Implementing Classes:
BrowserFieldResponse

public interface ContentConnection
extends StreamConnection

This interface defines the stream connection over which content is passed.

Blocking Operations

This interface performs blocking Input and Output operations. An application will lock if an implementation of this interface opens a connection from within the main event thread. Prevent an application from locking by opening a connection from within a thread that is separate from the main event thread. SeeConnector for more information.


Method Summary
 String getEncoding()
          Returns a string describing the encoding of the content which the resource connected to is providing.
 long getLength()
          Returns the length of the content which is being provided.
 String getType()
          Returns the type of content that the resource connected to is providing.
 
Methods inherited from interface javax.microedition.io.InputConnection
openDataInputStream, openInputStream
 
Methods inherited from interface javax.microedition.io.Connection
close
 
Methods inherited from interface javax.microedition.io.OutputConnection
openDataOutputStream, openOutputStream
 
Methods inherited from interface javax.microedition.io.Connection
close
 



Method Detail

getType

String getType()
Returns the type of content that the resource connected to is providing. E.g. if the connection is via HTTP, then the value of the content-type header field is returned.

Returns:
the content type of the resource that the URL references, or null if not known.

getEncoding

String getEncoding()
Returns a string describing the encoding of the content which the resource connected to is providing. E.g. if the connection is via HTTP, the value of the content-encoding header field is returned.

Returns:
the content encoding of the resource that the URL references, or null if not known.

getLength

long getLength()
Returns the length of the content which is being provided. E.g. if the connection is via HTTP, then the value of the content-length header field is returned.

Returns:
the content length of the resource that this connection's URL references, or -1 if the content length is not known.





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal