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

Public 成员函数

包函数

包属性

额外继承的成员函数

详细描述

在文件 FileStream.x133 行定义.

构造及析构函数说明

◆ FileOutputStream() [1/14]

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

在文件 FileStream.x135 行定义.

135 {
136 if (path == nilptr){
137 throw new NullPointerException("path is nilptr");
138 }
139 filehandler = XPlatform.openSystemFile(path, mode);
140 if (filehandler == -1){
141 throw new IllegalArgumentException("file " + path + " can not open");
142 }
143 }

◆ FileOutputStream() [2/14]

FileOutputStream ( String  path) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x144 行定义.

144 {
145 if (path == nilptr){
146 throw new NullPointerException("path is nilptr");
147 }
148 filehandler = XPlatform.openSystemFile(path, _system_.WRITE | _system_.CREATE | _system_.TRUNC);
149 if (filehandler == -1){
150 throw new IllegalArgumentException("file " + path + " can not open");
151 }
152 }
系统和IO相关
static const int CREATE
static const int TRUNC
static const int WRITE

引用了 _system_.CREATE, _system_.TRUNC , 以及 _system_.WRITE.

◆ FileOutputStream() [3/14]

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

在文件 FileStream.x153 行定义.

153 {
154 if (path == nilptr){
155 throw new NullPointerException("path is nilptr");
156 }
157 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
158 if (filehandler == -1){
159 throw new IllegalArgumentException("file " + path + " can not open");
160 }
161 }
static const int APPEND

引用了 _system_.APPEND, _system_.CREATE , 以及 _system_.TRUNC.

◆ FileOutputStream() [4/14]

FileOutputStream ( @NotNilptr File  file) throws NullPointerException, IllegalArgumentException

在文件 FileStream.x163 行定义.

163 {
164 String path = file.getPath();
165 if (path == nilptr){
166 throw new NullPointerException("path is nilptr");
167 }
168 filehandler = XPlatform.openSystemFile(path, _system_.WRITE | _system_.CREATE | _system_.TRUNC);
169 if (filehandler == -1){
170 throw new IllegalArgumentException("file " + path + " can not open");
171 }
172 }
字符串类

引用了 _system_.CREATE, _system_.TRUNC , 以及 _system_.WRITE.

◆ FileOutputStream() [5/14]

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

在文件 FileStream.x173 行定义.

173 {
174 String path = file.getPath();
175 if (path == nilptr){
176 throw new NullPointerException("path is nilptr");
177 }
178 filehandler = XPlatform.openSystemFile(path, mode);
179 if (filehandler == -1){
180 throw new IllegalArgumentException("file " + path + " can not open");
181 }
182 }

◆ FileOutputStream() [6/14]

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

在文件 FileStream.x183 行定义.

183 {
184 String path = file.getPath();
185 if (path == nilptr){
186 throw new NullPointerException("path is nilptr");
187 }
188 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
189 if (filehandler == -1){
190 throw new IllegalArgumentException("file " + path + " can not open");
191 }
192 }

引用了 _system_.APPEND, _system_.CREATE , 以及 _system_.TRUNC.

◆ FileOutputStream() [7/14]

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

在文件 FileStream.x193 行定义.

193 {
194 String path = dir.getPath();
195 if (path == nilptr){
196 throw new NullPointerException("path is nilptr");
197 }
198 path = path.appendPath(file);
199 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
200 if (filehandler == -1){
201 throw new IllegalArgumentException("file " + path + " can not open");
202 }
203 }
String appendPath(String)

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

◆ FileOutputStream() [8/14]

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

在文件 FileStream.xcs134 行定义.

134 {
135 if (path == nilptr){
136 throw new NullPointerException("path is nilptr");
137 }
138 filehandler = XPlatform.openSystemFile(path, mode);
139 if (filehandler == -1){
140 throw new IllegalArgumentException("file " + path + " can not open");
141 }
142 }

◆ FileOutputStream() [9/14]

FileOutputStream ( String  path) throws NullPointerException, IllegalArgumentException

在文件 FileStream.xcs143 行定义.

143 {
144 if (path == nilptr){
145 throw new NullPointerException("path is nilptr");
146 }
147 filehandler = XPlatform.openSystemFile(path, _system_.WRITE | _system_.CREATE | _system_.TRUNC);
148 if (filehandler == -1){
149 throw new IllegalArgumentException("file " + path + " can not open");
150 }
151 }

引用了 _system_.CREATE, _system_.TRUNC , 以及 _system_.WRITE.

◆ FileOutputStream() [10/14]

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

在文件 FileStream.xcs152 行定义.

152 {
153 if (path == nilptr){
154 throw new NullPointerException("path is nilptr");
155 }
156 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
157 if (filehandler == -1){
158 throw new IllegalArgumentException("file " + path + " can not open");
159 }
160 }

引用了 _system_.APPEND, _system_.CREATE , 以及 _system_.TRUNC.

◆ FileOutputStream() [11/14]

FileOutputStream ( @NotNilptr File  file) throws NullPointerException, IllegalArgumentException

在文件 FileStream.xcs162 行定义.

162 {
163 String path = file.getPath();
164 if (path == nilptr){
165 throw new NullPointerException("path is nilptr");
166 }
167 filehandler = XPlatform.openSystemFile(path, _system_.WRITE | _system_.CREATE | _system_.TRUNC);
168 if (filehandler == -1){
169 throw new IllegalArgumentException("file " + path + " can not open");
170 }
171 }

引用了 _system_.CREATE, _system_.TRUNC , 以及 _system_.WRITE.

◆ FileOutputStream() [12/14]

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

在文件 FileStream.xcs172 行定义.

172 {
173 String path = file.getPath();
174 if (path == nilptr){
175 throw new NullPointerException("path is nilptr");
176 }
177 filehandler = XPlatform.openSystemFile(path, mode);
178 if (filehandler == -1){
179 throw new IllegalArgumentException("file " + path + " can not open");
180 }
181 }

◆ FileOutputStream() [13/14]

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

在文件 FileStream.xcs182 行定义.

182 {
183 String path = file.getPath();
184 if (path == nilptr){
185 throw new NullPointerException("path is nilptr");
186 }
187 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
188 if (filehandler == -1){
189 throw new IllegalArgumentException("file " + path + " can not open");
190 }
191 }

引用了 _system_.APPEND, _system_.CREATE , 以及 _system_.TRUNC.

◆ FileOutputStream() [14/14]

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

在文件 FileStream.xcs192 行定义.

192 {
193 String path = dir.getPath();
194 if (path == nilptr){
195 throw new NullPointerException("path is nilptr");
196 }
197 path = path.appendPath(file);
198 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
199 if (filehandler == -1){
200 throw new IllegalArgumentException("file " + path + " can not open");
201 }
202 }

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

成员函数说明

◆ attach() [1/2]

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

在文件 FileStream.x204 行定义.

204 {
205 if (filehandler != -1){
206 _system_.close(filehandler);
207 filehandler = -1;
208 }
209 if (path == nilptr){
210 throw new NullPointerException("path is nilptr");
211 }
212 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
213 return filehandler != -1;
214 }
static final bool close(long)

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

◆ attach() [2/2]

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

在文件 FileStream.xcs203 行定义.

203 {
204 if (filehandler != -1){
205 _system_.close(filehandler);
206 filehandler = -1;
207 }
208 if (path == nilptr){
209 throw new NullPointerException("path is nilptr");
210 }
211 filehandler = XPlatform.openSystemFile(path, append ? (_system_.CREATE | _system_.APPEND) : (_system_.WRITE | _system_.CREATE | _system_.TRUNC));
212 return filehandler != -1;
213 }

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

◆ available() [1/2]

long available ( bool   )
override

实现了 Stream.

在文件 FileStream.x220 行定义.

220 {
221 return 1;
222 }

◆ available() [2/2]

long available ( bool   )
override

实现了 Stream.

在文件 FileStream.xcs219 行定义.

219 {
220 return 1;
221 }

◆ checkValid() [1/2]

void checkValid ( ) throws IllegalArgumentException

在文件 FileStream.x215 行定义.

215 {
216 if (filehandler == -1){
217 throw new IllegalArgumentException("The Stream is not ready");
218 }
219 }

◆ checkValid() [2/2]

void checkValid ( ) throws IllegalArgumentException

在文件 FileStream.xcs214 行定义.

214 {
215 if (filehandler == -1){
216 throw new IllegalArgumentException("The Stream is not ready");
217 }
218 }

◆ close() [1/2]

void close ( )
override

实现了 Stream.

在文件 FileStream.x254 行定义.

254 {
255 if (filehandler != -1){
256 _system_.close(filehandler);
257 filehandler = -1;
258 }
259 }

引用了 _system_.close().

◆ close() [2/2]

void close ( )
override

实现了 Stream.

在文件 FileStream.xcs253 行定义.

253 {
254 if (filehandler != -1){
255 _system_.close(filehandler);
256 filehandler = -1;
257 }
258 }

引用了 _system_.close().

◆ finalize() [1/2]

void finalize ( )
package

在文件 FileStream.x263 行定义.

263 {
264 close();
265 }
void close() override
Definition FileStream.x:254

引用了 Stream.close().

◆ finalize() [2/2]

void finalize ( )
package

在文件 FileStream.xcs262 行定义.

262 {
263 close();
264 }

引用了 Stream.close().

◆ flush() [1/2]

void flush ( )
overridepackage

实现了 Stream.

在文件 FileStream.x260 行定义.

260 {
261
262 }

◆ flush() [2/2]

void flush ( )
overridepackage

实现了 Stream.

在文件 FileStream.xcs259 行定义.

259 {
260
261 }

◆ getPosition() [1/2]

long getPosition ( )
override

实现了 Stream.

在文件 FileStream.x227 行定义.

227 {
228 return 0;
229 }

◆ getPosition() [2/2]

long getPosition ( )
override

实现了 Stream.

在文件 FileStream.xcs226 行定义.

226 {
227 return 0;
228 }

◆ length() [1/2]

long length ( ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.x231 行定义.

231 {
232 checkValid();
233 return 0;
234 }

◆ length() [2/2]

long length ( ) throws IllegalArgumentException
override

实现了 Stream.

在文件 FileStream.xcs230 行定义.

230 {
231 checkValid();
232 return 0;
233 }

◆ read() [1/4]

byte [] read ( )

在文件 FileStream.x236 行定义.

236 {
237 return nilptr;
238 }

◆ read() [2/4]

byte [] read ( )

在文件 FileStream.xcs235 行定义.

235 {
236 return nilptr;
237 }

◆ read() [3/4]

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

在文件 FileStream.x240 行定义.

240 {
241 return 0;
242 }

◆ read() [4/4]

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

在文件 FileStream.xcs239 行定义.

239 {
240 return 0;
241 }

◆ seek() [1/2]

long seek ( int   ,
long   
)
override

实现了 Stream.

在文件 FileStream.x223 行定义.

223 {
224 return 0;
225 }

◆ seek() [2/2]

long seek ( int   ,
long   
)
override

实现了 Stream.

在文件 FileStream.xcs222 行定义.

222 {
223 return 0;
224 }

◆ write() [1/4]

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

在文件 FileStream.x244 行定义.

244 {
245 checkValid();
246 return _system_.write(filehandler, data, 0, data.length);
247 }
static final long write(long, byte[], long, long)

引用了 _system_.write().

◆ write() [2/4]

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

在文件 FileStream.xcs243 行定义.

243 {
244 checkValid();
245 return _system_.write(filehandler, data, 0, data.length);
246 }

引用了 _system_.write().

◆ write() [3/4]

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

实现了 Stream.

在文件 FileStream.x249 行定义.

249 {
250 checkValid();
251 return _system_.write(filehandler, data, position, length);
252 }

引用了 _system_.write().

◆ write() [4/4]

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

实现了 Stream.

在文件 FileStream.xcs248 行定义.

248 {
249 checkValid();
250 return _system_.write(filehandler, data, position, length);
251 }

引用了 _system_.write().

结构体成员变量说明

◆ filehandler

long filehandler
package

在文件 FileStream.x134 行定义.