java中rt包中源码了解

javap –verbose class名 查看class文件的具体内容

javap -c class名

 

继续看io类

接口 java.io.Closeable

功能:关闭流和相应的资源

java.io.console

功能:使用字节控制台,与当前的java virtual machine 相关

java.io.DataInput

功能:从二进制流中读取字节

java.io.DataInputStream

功能:从一个输入流中读取原始java数据类型。

public class DataInputStream extends FilterInputStream implements DataInput

 

java.io.DataOutput

功能:任何java原始类型的数据转化为字节,将这些字节写到字节流流中

java.io.DataOutputStream

功能:将原始的java数据类型写入输出流中,也可以用datainputstream将数据读回

java.io.DeleteOnExitHook

功能:持有已经删除的文件集

 java.io.EOFException

 功能:指示文件的结尾,或已到达流文件的结尾。

 java.io.ExpiringCache

  功能:清除过期的实体对象

    static class Entry {

        private long   timestamp;

        private String val;

 

        Entry(long timestamp, String val) {

            this.timestamp = timestamp;

            this.val = val;

        }

 

        long   timestamp()                  { return timestamp;           }

        void   setTimestamp(long timestamp) { this.timestamp = timestamp; }

 

        String val()                        { return val;                 }

        void   setVal(String val)           { this.val = val;             }

    }

java.io.Externalizable

功能:只有实现了这个接口的实例才会写入序列化的流中,负责保存这个实例的内容。

java.io.File

功能:代表抽象的文件和目录路径名

 By default the classes in the

 <code>java.io</code> package always resolve relative pathnames against the

current user directory.  This directory is named by the system property

 <code>user.dir</code>, and is typically the directory in which the Java

 virtual machine was invoked.

 

 static private FileSystem fs = FileSystem.getFileSystem();

 

 file.separator

 On UNIX systems the value of this

  field is <code>'/'</code>;

 on Microsoft Windows systems it is <code>'\\'</code>.

 

   public static final char separatorChar = fs.getSeparator();

 

This character is used to

 separate filenames in a sequence of files given as a <em>path list</em>.

 On UNIX systems, this character is <code>':'</code>; on Microsoft Windows systems it is <code>';'</code>.

  public static final char pathSeparatorChar = fs.getPathSeparator();

 

 

public File(URI uri) {

 

        // Check our many preconditions

        if (!uri.isAbsolute())

            throw new IllegalArgumentException("URI is not absolute");

        if (uri.isOpaque())

            throw new IllegalArgumentException("URI is not hierarchical");

        String scheme = uri.getScheme();

        if ((scheme == null) || !scheme.equalsIgnoreCase("file"))

            throw new IllegalArgumentException("URI scheme is not \"file\"");

        if (uri.getAuthority() != null)

            throw new IllegalArgumentException("URI has an authority component");

        if (uri.getFragment() != null)

            throw new IllegalArgumentException("URI has a fragment component");

        if (uri.getQuery() != null)

            throw new IllegalArgumentException("URI has a query component");

        String p = uri.getPath();

        if (p.equals(""))

            throw new IllegalArgumentException("URI path component is empty");

 

        // Okay, now initialize

        p = fs.fromURIPath(p);

        if (File.separatorChar != '/')

            p = p.replace('/', File.separatorChar);

        this.path = fs.normalize(p);

        this.prefixLength = fs.prefixLength(this.path);

    }

 

转载于:https://my.oschina.net/iioschina/blog/808145

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值