contentconnection.java

来自「This is a resource based on j2me embedde」· Java 代码 · 共 78 行

JAVA
78
字号
/* * Copyright  1990-2008 Sun Microsystems, Inc. All Rights Reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER *  * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 only, as published by the Free Software Foundation.  *  * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License version 2 for more details (a copy is * included at /legal/license.txt).  *  * You should have received a copy of the GNU General Public License * version 2 along with this work; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA  *  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa * Clara, CA 95054 or visit www.sun.com if you need additional * information or have any questions.  */package javax.microedition.io;import java.io.*;/** * This interface defines the stream connection over which * content is passed. * * @version 12/17/01 (CLDC 1.1) * @since   CLDC 1.0 */public interface ContentConnection extends StreamConnection {    /**     * Returns the type of content that the resource connected to is     * providing.  For instance, if the connection is via HTTP, then     * the value of the <code>content-type</code> header field is returned.     *     * @return  the content type of the resource that the URL references,     *          or <code>null</code> if not known.<p>     *          NOTE: In certain environments, such as HttpConnection     *          implemented on top of WAP, the content type is     *          always known even if content-type header field is      *          missing from the server response.  Therefore, in     *          certain cases, the content type might always be non-null     *          even if the content-type header field is missing.     */    public String getType();    /**     * 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     * <code>content-encoding</code> header field is returned.     *     * @return  the content encoding of the resource that the URL     *          references, or <code>null</code> if not known.     */    public String getEncoding();    /**     * Returns the length of the content which is being provided.     * E.g. if the connection is via HTTP, then the value of the     * <code>content-length</code> header field is returned.     *     * @return  the content length of the resource that this connection's     *          URL references, or <code>-1</code> if the content length     *          is not known.     */    public long getLength();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?