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

Public 成员函数

包函数

包属性

额外继承的成员函数

详细描述

在文件 FileStream.x127 行定义.

构造及析构函数说明

◆ FileOutputStream() [1/7]

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

在文件 FileStream.x129 行定义.

129 {
130 if (path == nilptr){
131 throw new NullPointerException("path is nilptr");
132 }
133 filehandler = _system_.open(path, mode);
134 if (filehandler == -1){
135 throw new IllegalArgumentException("file " + path + " can not open");
136 }
137 }
static final long open(String, int)

引用了 _system_.open().

函数调用图:

◆ FileOutputStream() [2/7]

FileOutputStream ( String  path) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x138 行定义.

138 {
139 if (path == nilptr){
140 throw new NullPointerException("path is nilptr");
141 }
143 if (filehandler == -1){
144 throw new IllegalArgumentException("file " + path + " can not open");
145 }
146 }
static const int CREATE
Definition _system_.x:235
static const int TRUNC
Definition _system_.x:238
static const int WRITE
Definition _system_.x:233

引用了 _system_.CREATE, _system_.open(), _system_.TRUNC , 以及 _system_.WRITE.

函数调用图:

◆ FileOutputStream() [3/7]

FileOutputStream ( String  path,
bool  append 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x147 行定义.

147 {
148 if (path == nilptr){
149 throw new NullPointerException("path is nilptr");
150 }
151 filehandler = _system_.open(path, append ? (_system_.WRITE | _system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
152 if (filehandler == -1){
153 throw new IllegalArgumentException("file " + path + " can not open");
154 }
155 }
static const int APPEND
Definition _system_.x:239

引用了 _system_.APPEND, _system_.CREATE, _system_.open(), _system_.TRUNC , 以及 _system_.WRITE.

函数调用图:

◆ FileOutputStream() [4/7]

FileOutputStream ( @NotNilptr File  file) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x157 行定义.

157 {
158 String path = file.getPath();
159 if (path == nilptr){
160 throw new NullPointerException("path is nilptr");
161 }
163 if (filehandler == -1){
164 throw new IllegalArgumentException("file " + path + " can not open");
165 }
166 }
Definition String.x:5

引用了 _system_.CREATE, _system_.open(), _system_.TRUNC , 以及 _system_.WRITE.

函数调用图:

◆ FileOutputStream() [5/7]

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

在文件 FileStream.x167 行定义.

167 {
168 String path = file.getPath();
169 if (path == nilptr){
170 throw new NullPointerException("path is nilptr");
171 }
172 filehandler = _system_.open(path, mode);
173 if (filehandler == -1){
174 throw new IllegalArgumentException("file " + path + " can not open");
175 }
176 }

引用了 _system_.open().

函数调用图:

◆ FileOutputStream() [6/7]

FileOutputStream ( @NotNilptr File  file,
bool  append 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x177 行定义.

177 {
178 String path = file.getPath();
179 if (path == nilptr){
180 throw new NullPointerException("path is nilptr");
181 }
182 filehandler = _system_.open(path, append ? (_system_.WRITE | _system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
183 if (filehandler == -1){
184 throw new IllegalArgumentException("file " + path + " can not open");
185 }
186 }

引用了 _system_.APPEND, _system_.CREATE, _system_.open(), _system_.TRUNC , 以及 _system_.WRITE.

函数调用图:

◆ FileOutputStream() [7/7]

FileOutputStream ( @NotNilptr File  dir,
@NotNilptr String  file,
bool  append 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x187 行定义.

187 {
188 String path = dir.getPath();
189 if (path == nilptr){
190 throw new NullPointerException("path is nilptr");
191 }
192 path = path.appendPath(file);
193 filehandler = _system_.open(path, append ? (_system_.WRITE | _system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
194 if (filehandler == -1){
195 throw new IllegalArgumentException("file " + path + " can not open");
196 }
197 }
String appendPath(String)

引用了 _system_.APPEND, String.appendPath(), _system_.CREATE, _system_.open(), _system_.TRUNC , 以及 _system_.WRITE.

函数调用图:

成员函数说明

◆ attach()

bool attach ( String  path,
bool  append 
) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x198 行定义.

198 {
199 if (filehandler != -1){
200 _system_.close(filehandler);
201 filehandler = -1;
202 }
203 if (path == nilptr){
204 throw new NullPointerException("path is nilptr");
205 }
206 filehandler = _system_.open(path, append ? (_system_.WRITE | _system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
207 return filehandler != -1;
208 }
static final bool close(long)

引用了 _system_.APPEND, _system_.close(), _system_.CREATE, _system_.open(), _system_.TRUNC , 以及 _system_.WRITE.

函数调用图:

◆ available()

long available ( bool   )
override

重载 Stream .

在文件 FileStream.x214 行定义.

214 {
215 return 1;
216 }

◆ checkValid()

void checkValid ( ) throws IllegalArgumentException

在文件 FileStream.x209 行定义.

209 {
210 if (filehandler == -1){
211 throw new IllegalArgumentException("The Stream is not ready");
212 }
213 }

◆ close()

void close ( )
override

重载 Stream .

在文件 FileStream.x244 行定义.

244 {
245 if (filehandler != -1){
246 _system_.close(filehandler);
247 filehandler = -1;
248 }
249 }

引用了 _system_.close().

函数调用图:

◆ finalize()

void finalize ( )
package

在文件 FileStream.x253 行定义.

253 {
254 close();
255 }
void close() override
Definition FileStream.x:244

引用了 Stream.close().

函数调用图:

◆ flush()

void flush ( )
overridepackage

重载 Stream .

在文件 FileStream.x250 行定义.

250 {
251
252 }

◆ getPosition()

long getPosition ( )
override

重载 Stream .

在文件 FileStream.x221 行定义.

221 {
222 return 0;
223 }

◆ length()

long length ( ) throws IllegalArgumentException
override

重载 Stream .

在文件 FileStream.x225 行定义.

225 {
226 checkValid();
227 return 0;
228 }

◆ read()

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

在文件 FileStream.x230 行定义.

230 {
231 return 0;
232 }

◆ seek()

long seek ( int   ,
long   
)
override

重载 Stream .

在文件 FileStream.x217 行定义.

217 {
218 return 0;
219 }

◆ write() [1/2]

long write ( @NotNilptr byte []  data) throws IndexOutOfBoundsException , IllegalArgumentException

在文件 FileStream.x234 行定义.

234 {
235 checkValid();
236 return _system_.write(filehandler, data, 0, data.length);
237 }
static final long write(long, byte[], long, long)

引用了 _system_.write().

函数调用图:

◆ write() [2/2]

int write ( byte []  data,
int  position,
int  length 
) throws IndexOutOfBoundsException, IllegalArgumentException
override

在文件 FileStream.x239 行定义.

239 {
240 checkValid();
241 return _system_.write(filehandler, data, position, length);
242 }

引用了 _system_.write().

函数调用图:

结构体成员变量说明

◆ filehandler

long filehandler
package

在文件 FileStream.x128 行定义.