• 【转】Closeable, Readable, Flushable, Appendable


    Closeable:

    package java.io;
    
    import java.io.IOException;
    
    public interface Closeable {
        /**
         * Closes this stream and releases any system resources associated
         * with it. If the stream is already closed then invoking this 
         * method has no effect. 
         */
        public void close() throws IOException;
    }

    Readable:

    package java.lang;
    
    import java.io.IOException;
    
    public interface Readable {
    
        /**
         * Attempts to read characters into the specified character buffer.
         * The buffer is used as a repository of characters as-is: the only
         * changes made are the results of a put operation. No flipping or
         * rewinding of the buffer is performed.
         */
        public int read(java.nio.CharBuffer cb) throws IOException;
    }
    Flushable:
    package java.io;
    
    import java.io.IOException;
    
    public interface Flushable {
    
        /**
         * Flushes this stream by writing any buffered output to the underlying stream.
         */
        void flush() throws IOException;
    }

    Appendable:

    package java.lang;
    
    import java.io.IOException;
    
    public interface Appendable {
    
        /**
         * Appends the specified character sequence to this Appendable.
         * @return  A reference to this Appendable
         */
        Appendable append(CharSequence csq) throws IOException;
    
        /**
         * Appends a subsequence of the specified character sequence to this Appendable.
         * @return  A reference to this Appendable
         */
        Appendable append(CharSequence csq, int start, int end) throws IOException;
    
        /**
         * Appends the specified character to this Appendable.
         * @return  A reference to this Appendable
         */
        Appendable append(char c) throws IOException;
    }

     转自:https://blog.csdn.net/jjavaboy/article/details/43093435

    你若笃定,世界便不浮躁。
  • 相关阅读:
    powerdesigner 字段添加注释和默认值
    springboot集成enchance
    判断字段数据什么数据类型
    springboot打成jar包涉及到的linux命令
    springdatajpa添加完modle之后立即返回id
    阿里云上部署环境
    STS 启动之后, "Initializing Java Tooling" 一直卡住问题解决
    C#访问MongoDB数据
    MongoDB开发学习(1)开天辟地,经典入门
    Step by Step 設定 TFS 2012 Create Team Project 權限
  • 原文地址:https://www.cnblogs.com/zhangyue123/p/9277547.html
Copyright © 2020-2023  润新知