All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.tobato.fastdfs.conn.Connection Maven / Gradle / Ivy

There is a newer version: 1.27.2
Show newest version
package com.github.tobato.fastdfs.conn;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;

/**
 * 表示一个客户端与服务端的连接
 * 
 * 负责连接的管理
 * 
 * @author tobato
 *
 */
public interface Connection {

    /**
     * 关闭连接
     */
    void close();

    /**
     * 连接是否关闭
     * 
     * @return
     */
    boolean isClosed();

    /**
     * 测试连接是否有效
     * 
     * @return
     */
    boolean isValid();

    /**
     * 获取输出流
     * 
     * @return
     * @throws IOException
     */
    public OutputStream getOutputStream() throws IOException;

    /**
     * 获取输入流
     * 
     * @return 输入流
     * @throws IOException 获取输入流错误
     */
    public InputStream getInputStream() throws IOException;

    /**
     * 获取字符集
     * 
     * @return 字符集
     */
    public Charset getCharset();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy