xlang v4.0 Release
程序设计语言基础库文档
载入中...
搜索中...
未找到
Public 成员函数 | 包函数 | 包属性
FileInputStream类 参考
类 FileInputStream 继承关系图:
Stream Stream

Public 成员函数

包函数

包属性

额外继承的成员函数

详细描述

在文件 FileStream.x4 行定义.

构造及析构函数说明

◆ FileInputStream() [1/10]

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

在文件 FileStream.x6 行定义.

9 {
10 if (path == nilptr){
11 throw new NullPointerException("path is nullpointer");
12 }
13 filehandler = XPlatform.openSystemFile(path, _system_.READ | mode);
14 if (filehandler == -1){
15 throw new IllegalArgumentException("file " + path + " can not open");
16 }
17 }
系统和IO相关
static const int READ

引用了 _system_.READ.

◆ FileInputStream() [2/10]

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

在文件 FileStream.x18 行定义.

21 {
22 String path = file.getPath();
23 if (path == nilptr){
24 throw new NullPointerException("path is nilptr");
25 }
26 filehandler = XPlatform.openSystemFile(path, _system_.READ | mode);
27 if (filehandler == -1){
28 throw new IllegalArgumentException("file " + path + " can not open");
29 }
30 }
字符串类

引用了 _system_.READ.

◆ FileInputStream() [3/10]

FileInputStream ( String  path) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x31 行定义.

34 {
35 if (path == nilptr){
36 throw new NullPointerException("path is nullpointer");
37 }
38 filehandler = XPlatform.openSystemFile(path, _system_.READ);
39 if (filehandler == -1){
40 throw new IllegalArgumentException("file " + path + " can not open");
41 }
42 }

引用了 _system_.READ.

◆ FileInputStream() [4/10]

FileInputStream ( @NotNilptr File  file) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x43 行定义.

46 {
47 String path = file.getPath();
48 if (path == nilptr){
49 throw new NullPointerException("path is nilptr");
50 }
51 filehandler = XPlatform.openSystemFile(path, _system_.READ);
52 if (filehandler == -1){
53 throw new IllegalArgumentException("file " + path + " can not open");
54 }
55 }

引用了 _system_.READ.

◆ FileInputStream() [5/10]

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

在文件 FileStream.x56 行定义.

56 {
57 String path = dir.getPath();
58 if (path == nilptr){
59 throw new NullPointerException("path is nilptr");
60 }
61 path = path.appendPath(file);
62 filehandler = XPlatform.openSystemFile(path, _system_.READ);
63 if (filehandler == -1){
64 throw new IllegalArgumentException("file " + path + " can not open");
65 }
66 }
String appendPath(String)

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

◆ FileInputStream() [6/10]

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

在文件 FileStream.xcs6 行定义.

9 {
10 if (path == nilptr){
11 throw new NullPointerException("path is nullpointer");
12 }
13 filehandler = XPlatform.openSystemFile(path, _system_.READ | mode);
14 if (filehandler == -1){
15 throw new IllegalArgumentException("file " + path + " can not open");
16 }
17 }

引用了 _system_.READ.

◆ FileInputStream() [7/10]

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

在文件 FileStream.xcs18 行定义.

21 {
22 String path = file.getPath();
23 if (path == nilptr){
24 throw new NullPointerException("path is nilptr");
25 }
26 filehandler = XPlatform.openSystemFile(path, _system_.READ | mode);
27 if (filehandler == -1){
28 throw new IllegalArgumentException("file " + path + " can not open");
29 }
30 }

引用了 _system_.READ.

◆ FileInputStream() [8/10]

FileInputStream ( String  path) throws NullPointerException, IllegalArgumentException

在文件 FileStream.xcs31 行定义.

34 {
35 if (path == nilptr){
36 throw new NullPointerException("path is nullpointer");
37 }
38 filehandler = XPlatform.openSystemFile(path, _system_.READ);
39 if (filehandler == -1){
40 throw new IllegalArgumentException("file " + path + " can not open");
41 }
42 }

引用了 _system_.READ.

◆ FileInputStream() [9/10]

FileInputStream ( @NotNilptr File  file) throws NullPointerException, IllegalArgumentException

在文件 FileStream.xcs43 行定义.

46 {
47 String path = file.getPath();
48 if (path == nilptr){
49 throw new NullPointerException("path is nilptr");
50 }
51 filehandler = XPlatform.openSystemFile(path, _system_.READ);
52 if (filehandler == -1){
53 throw new IllegalArgumentException("file " + path + " can not open");
54 }
55 }

引用了 _system_.READ.

◆ FileInputStream() [10/10]

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

在文件 FileStream.xcs56 行定义.

56 {
57 String path = dir.getPath();
58 if (path == nilptr){
59 throw new NullPointerException("path is nilptr");
60 }
61 path = path.appendPath(file);
62 filehandler = XPlatform.openSystemFile(path, _system_.READ);
63 if (filehandler == -1){
64 throw new IllegalArgumentException("file " + path + " can not open");
65 }
66 }

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

成员函数说明

◆ attach() [1/2]

bool attach ( String  path) throws IllegalArgumentException

在文件 FileStream.x67 行定义.

67 {
68 if (filehandler != -1){
69 _system_.close(filehandler);
70 filehandler = -1;
71 }
72 if (path == nilptr){
73 return false;
74 }
75 filehandler = XPlatform.openSystemFile(path, _system_.READ);
76 return filehandler != -1;
77 }
static final bool close(long)

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

◆ attach() [2/2]

bool attach ( String  path) throws IllegalArgumentException

在文件 FileStream.xcs67 行定义.

67 {
68 if (filehandler != -1){
69 _system_.close(filehandler);
70 filehandler = -1;
71 }
72 if (path == nilptr){
73 return false;
74 }
75 filehandler = XPlatform.openSystemFile(path, _system_.READ);
76 return filehandler != -1;
77 }

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

◆ available() [1/2]

long available ( bool   ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.x84 行定义.

84 {
85 return length() - getPosition();
86 }
long length() override
Definition FileStream.x:97
long getPosition() override
Definition FileStream.x:92

◆ available() [2/2]

long available ( bool   ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.xcs84 行定义.

84 {
85 return length() - getPosition();
86 }

◆ checkValid() [1/2]

void checkValid ( ) throws IllegalArgumentException

在文件 FileStream.x79 行定义.

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

◆ checkValid() [2/2]

void checkValid ( ) throws IllegalArgumentException

在文件 FileStream.xcs79 行定义.

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

◆ close() [1/2]

void close ( )
override

实现了 Stream.

在文件 FileStream.x119 行定义.

119 {
120 if (filehandler != -1){
121 _system_.close(filehandler);
122 filehandler = -1;
123 }
124 }

引用了 _system_.close().

被这些函数引用 OSProcess.getProcessListUnix().

◆ close() [2/2]

void close ( )
override

实现了 Stream.

在文件 FileStream.xcs118 行定义.

118 {
119 if (filehandler != -1){
120 _system_.close(filehandler);
121 filehandler = -1;
122 }
123 }

引用了 _system_.close().

◆ finalize() [1/2]

void finalize ( )
package

在文件 FileStream.x128 行定义.

128 {
129 close();
130 }
void close() override
Definition FileStream.x:119

◆ finalize() [2/2]

void finalize ( )
package

在文件 FileStream.xcs127 行定义.

127 {
128 close();
129 }

◆ flush() [1/2]

void flush ( )
overridepackage

实现了 Stream.

在文件 FileStream.x125 行定义.

125 {
126
127 }

◆ flush() [2/2]

void flush ( )
overridepackage

实现了 Stream.

在文件 FileStream.xcs124 行定义.

124 {
125
126 }

◆ getPosition() [1/2]

long getPosition ( ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.x92 行定义.

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

引用了 _system_.getSeek().

◆ getPosition() [2/2]

long getPosition ( ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.xcs92 行定义.

92 {
93 checkValid();
94 return _system_.getSeek(filehandler);
95 }

引用了 _system_.getSeek().

◆ length() [1/2]

long length ( ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.x97 行定义.

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

引用了 _system_.getLength().

◆ length() [2/2]

long length ( ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.xcs97 行定义.

97 {
98 checkValid();
99 return _system_.getLength(filehandler);
100 }

引用了 _system_.getLength().

◆ read() [1/4]

在文件 FileStream.x103 行定义.

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

引用了 _system_.read().

被这些函数引用 OSProcess.getProcessListUnix().

◆ read() [2/4]

在文件 FileStream.xcs102 行定义.

102 {
103 checkValid();
104 byte[] data = new byte[length()];
105 _system_.read(filehandler, data, 0, data.length);
106 return data;
107 }

引用了 _system_.read().

◆ read() [3/4]

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

在文件 FileStream.x110 行定义.

110 {
111 checkValid();
112 return _system_.read(filehandler, data, position, length);
113 }

引用了 _system_.read().

◆ read() [4/4]

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

在文件 FileStream.xcs109 行定义.

109 {
110 checkValid();
111 return _system_.read(filehandler, data, position, length);
112 }

引用了 _system_.read().

◆ seek() [1/2]

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

实现了 Stream.

在文件 FileStream.x87 行定义.

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

引用了 _system_.seek().

◆ seek() [2/2]

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

实现了 Stream.

在文件 FileStream.xcs87 行定义.

87 {
88 checkValid();
89 return _system_.seek(filehandler, type, pos);
90 }

引用了 _system_.seek().

◆ write() [1/2]

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

在文件 FileStream.x115 行定义.

115 {
116 return 0;
117 }

◆ write() [2/2]

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

在文件 FileStream.xcs114 行定义.

114 {
115 return 0;
116 }

结构体成员变量说明

◆ filehandler

long filehandler = -1
package

在文件 FileStream.x5 行定义.