zoukankan      html  css  js  c++  java
  • InputStream接口的常见实现类

    一. FileInputStream

      FileInputStream可以从系统文件中获取输入字节,也从可以从诸从图象数据的的原始字节流中读取。 如果是读取字符串流,推荐使用FileReader。

    感觉就是视频,音频,图象之类的文件,就用FileInputStream读取。而如果是纯文字(字符串)文件就用FileReader读取。

      

    二. FilterInputStream

       对其它的InputStream输入流进行包装,将其作为基础数据源,可能会对其进行数据转换或者提供某些额外功能,对FilterInputStream对象的操作,实际上是对其包装的inputStream进行操作。

    public class FilterInputStream extends InputStream {
        /**
         * The input stream to be filtered.
         */
        protected volatile InputStream in;
    
        /**
         * Creates a <code>FilterInputStream</code>
         * by assigning the  argument <code>in</code>
         * to the field <code>this.in</code> so as
         * to remember it for later use.
         *
         * @param   in   the underlying input stream, or <code>null</code> if
         *          this instance is to be created without an underlying stream.
         */
        protected FilterInputStream(InputStream in) {
            this.in = in;
        }
    }

      

  • 相关阅读:
    Jmeter压力测试-结果分析(三十)
    C#正则密码验证
    Docker
    c# framework 缓存依赖
    NETMQ订阅,超时断线重连
    RabbitMQ发布/订阅模式
    RAS非对称加密解密,公钥私钥
    .NETCore批量插入数据BulkLoader
    .NETcore使用CSRedisCore操作Redis
    Rabbitmq简单队列
  • 原文地址:https://www.cnblogs.com/z-qinfeng/p/11788008.html
Copyright © 2011-2022 走看看