xlang v5.1 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
FileInputStream类 参考
类 FileInputStream 继承关系图:
Inheritance graph
FileInputStream 的协作图:
Collaboration graph

Public 成员函数

包函数

包属性

额外继承的成员函数

详细描述

在文件 FileStream.x6 行定义.

构造及析构函数说明

◆ FileInputStream() [1/5]

FileInputStream ( String  path,
int  mode 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x8 行定义.

11 {
12 if (path == nilptr){
13 throw new NullPointerException("path is nullpointer");
14 }
15 filehandler = _system_.open(path, _system_.READ | mode);
16 if (filehandler == -1){
17 throw new IllegalArgumentException("file " + path + " can not open");
18 }
19 }
static const int READ
Definition _system_.x:232
static final long open(String, int)

引用了 _system_.open() , 以及 _system_.READ.

函数调用图:

◆ FileInputStream() [2/5]

FileInputStream ( @NotNilptr File  file,
int  mode 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x20 行定义.

23 {
24 String path = file.getPath();
25 if (path == nilptr){
26 throw new NullPointerException("path is nilptr");
27 }
28 filehandler = _system_.open(path, _system_.READ | mode);
29 if (filehandler == -1){
30 throw new IllegalArgumentException("file " + path + " can not open");
31 }
32 }
Definition String.x:5

引用了 _system_.open() , 以及 _system_.READ.

函数调用图:

◆ FileInputStream() [3/5]

FileInputStream ( String  path) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x33 行定义.

36 {
37 if (path == nilptr){
38 throw new NullPointerException("path is nullpointer");
39 }
41 if (filehandler == -1){
42 throw new IllegalArgumentException("file " + path + " can not open");
43 }
44 }

引用了 _system_.open() , 以及 _system_.READ.

函数调用图:

◆ FileInputStream() [4/5]

FileInputStream ( @NotNilptr File  file) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x45 行定义.

48 {
49 String path = file.getPath();
50 if (path == nilptr){
51 throw new NullPointerException("path is nilptr");
52 }
54 if (filehandler == -1){
55 throw new IllegalArgumentException("file " + path + " can not open");
56 }
57 }

引用了 _system_.open() , 以及 _system_.READ.

函数调用图:

◆ FileInputStream() [5/5]

FileInputStream ( @NotNilptr File  dir,
@NotNilptr String  file 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x58 行定义.

58 {
59 String path = dir.getPath();
60 if (path == nilptr){
61 throw new NullPointerException("path is nilptr");
62 }
63 path = path.appendPath(file);
65 if (filehandler == -1){
66 throw new IllegalArgumentException("file " + path + " can not open");
67 }
68 }
String appendPath(String)

引用了 String.appendPath(), _system_.open() , 以及 _system_.READ.

函数调用图:

成员函数说明

◆ attach()

bool attach ( String  path) throws IllegalArgumentException

在文件 FileStream.x69 行定义.

69 {
70 if (filehandler != -1){
71 _system_.close(filehandler);
72 filehandler = -1;
73 }
74 if (path == nilptr){
75 return false;
76 }
78 return filehandler != -1;
79 }
static final bool close(long)

引用了 _system_.close(), _system_.open() , 以及 _system_.READ.

函数调用图:

◆ available()

long available ( bool   ) throws IllegalArgumentException
override

重载 Stream .

在文件 FileStream.x86 行定义.

86 {
87 return length() - getPosition();
88 }
long length() override
Definition FileStream.x:99
long getPosition() override
Definition FileStream.x:94

◆ checkValid()

void checkValid ( ) throws IllegalArgumentException

在文件 FileStream.x81 行定义.

81 {
82 if (filehandler == -1){
83 throw new IllegalArgumentException("The Stream is not ready");
84 }
85 }

◆ close()

void close ( )
override

重载 Stream .

在文件 FileStream.x113 行定义.

113 {
114 if (filehandler != -1){
115 _system_.close(filehandler);
116 filehandler = -1;
117 }
118 }

引用了 _system_.close().

函数调用图:

◆ finalize()

void finalize ( )
package

在文件 FileStream.x122 行定义.

122 {
123 close();
124 }
void close() override
Definition FileStream.x:113

◆ flush()

void flush ( )
overridepackage

重载 Stream .

在文件 FileStream.x119 行定义.

119 {
120
121 }

◆ getPosition()

long getPosition ( ) throws IllegalArgumentException
override

重载 Stream .

在文件 FileStream.x94 行定义.

94 {
95 checkValid();
96 return _system_.getSeek(filehandler);
97 }
static final long getSeek(long)

引用了 _system_.getSeek().

函数调用图:

◆ length()

long length ( ) throws IllegalArgumentException
override

重载 Stream .

在文件 FileStream.x99 行定义.

99 {
100 checkValid();
101 return _system_.getLength(filehandler);
102 }
static final long getLength(long)

引用了 _system_.getLength().

函数调用图:

◆ read()

int read ( @NotNilptr byte []  data,
int  position,
int  length 
) throws IllegalArgumentException, IndexOutOfBoundsException
override

在文件 FileStream.x104 行定义.

104 {
105 checkValid();
106 return _system_.read(filehandler, data, position, length);
107 }
static final long read(long, byte[], long, long)

引用了 _system_.read().

函数调用图:

◆ seek()

long seek ( int  type,
long  pos 
) throws IllegalArgumentException
override

重载 Stream .

在文件 FileStream.x89 行定义.

89 {
90 checkValid();
91 return _system_.seek(filehandler, type, pos);
92 }
static final long seek(long, int, long)

引用了 _system_.seek().

函数调用图:

◆ write()

int write ( @NotNilptr  byte[],
int  ,
int   
)
override

在文件 FileStream.x109 行定义.

109 {
110 return 0;
111 }

结构体成员变量说明

◆ filehandler

long filehandler = -1
package

在文件 FileStream.x7 行定义.