Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
420617ce
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
420617ce
编写于
3月 10, 2008
作者:
M
martin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6631437: File{In,Out}putStream minor improvements to spec and stylistic improvements to code
Reviewed-by: alanb, iris
上级
c3da802e
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
17 addition
and
19 deletion
+17
-19
src/share/classes/java/io/FileInputStream.java
src/share/classes/java/io/FileInputStream.java
+6
-6
src/share/classes/java/io/FileOutputStream.java
src/share/classes/java/io/FileOutputStream.java
+11
-13
未找到文件。
src/share/classes/java/io/FileInputStream.java
浏览文件 @
420617ce
...
...
@@ -48,14 +48,14 @@ public
class
FileInputStream
extends
InputStream
{
/* File Descriptor - handle to the open file */
private
FileDescriptor
fd
;
private
final
FileDescriptor
fd
;
private
FileChannel
channel
=
null
;
private
Object
closeLock
=
new
Object
();
private
final
Object
closeLock
=
new
Object
();
private
volatile
boolean
closed
=
false
;
private
static
ThreadLocal
<
Boolean
>
runningFinalize
=
private
static
final
ThreadLocal
<
Boolean
>
runningFinalize
=
new
ThreadLocal
<
Boolean
>();
private
static
boolean
isRunningFinalize
()
{
...
...
@@ -151,7 +151,7 @@ class FileInputStream extends InputStream
* is thrown.
* <p>
* This constructor does not throw an exception if <code>fdObj</code>
* is {link java.io.FileDescriptor#valid() invalid}.
* is {
@
link java.io.FileDescriptor#valid() invalid}.
* However, if the methods are invoked on the resulting stream to attempt
* I/O on the stream, an <code>IOException</code> is thrown.
*
...
...
@@ -389,7 +389,7 @@ class FileInputStream extends InputStream
* @see java.io.FileInputStream#close()
*/
protected
void
finalize
()
throws
IOException
{
if
((
fd
!=
null
)
&&
(
fd
!=
fd
.
in
))
{
if
((
fd
!=
null
)
&&
(
fd
!=
FileDescriptor
.
in
))
{
/*
* Finalizer should not release the FileDescriptor if another
...
...
src/share/classes/java/io/FileOutputStream.java
浏览文件 @
420617ce
...
...
@@ -52,19 +52,17 @@ public
class
FileOutputStream
extends
OutputStream
{
/**
* The system dependent file descriptor. The value is
* 1 more than actual file descriptor. This means that
* the default value 0 indicates that the file is not open.
* The system dependent file descriptor.
*/
private
FileDescriptor
fd
;
private
final
FileDescriptor
fd
;
private
FileChannel
channel
=
null
;
private
boolean
append
=
false
;
private
Object
closeLock
=
new
Object
();
private
final
Object
closeLock
=
new
Object
();
private
volatile
boolean
closed
=
false
;
private
static
ThreadLocal
<
Boolean
>
runningFinalize
=
private
static
final
ThreadLocal
<
Boolean
>
runningFinalize
=
new
ThreadLocal
<
Boolean
>();
private
static
boolean
isRunningFinalize
()
{
...
...
@@ -75,7 +73,7 @@ class FileOutputStream extends OutputStream
}
/**
* Creates a
n output file
stream to write to the file with the
* Creates a
file output
stream to write to the file with the
* specified name. A new <code>FileDescriptor</code> object is
* created to represent this file connection.
* <p>
...
...
@@ -100,8 +98,8 @@ class FileOutputStream extends OutputStream
}
/**
* Creates a
n output file
stream to write to the file with the specified
*
<code>name</code>
. If the second argument is <code>true</code>, then
* Creates a
file output
stream to write to the file with the specified
*
name
. If the second argument is <code>true</code>, then
* bytes will be written to the end of the file rather than the beginning.
* A new <code>FileDescriptor</code> object is created to represent this
* file connection.
...
...
@@ -211,7 +209,7 @@ class FileOutputStream extends OutputStream
}
/**
* Creates a
n output file
stream to write to the specified file
* Creates a
file output
stream to write to the specified file
* descriptor, which represents an existing connection to an actual
* file in the file system.
* <p>
...
...
@@ -223,7 +221,7 @@ class FileOutputStream extends OutputStream
* is thrown.
* <p>
* This constructor does not throw an exception if <code>fdObj</code>
* is {link java.io.FileDescriptor#valid() invalid}.
* is {
@
link java.io.FileDescriptor#valid() invalid}.
* However, if the methods are invoked on the resulting stream to attempt
* I/O on the stream, an <code>IOException</code> is thrown.
*
...
...
@@ -408,7 +406,7 @@ class FileOutputStream extends OutputStream
*/
protected
void
finalize
()
throws
IOException
{
if
(
fd
!=
null
)
{
if
(
fd
==
fd
.
out
||
fd
==
fd
.
err
)
{
if
(
fd
==
FileDescriptor
.
out
||
fd
==
FileDescriptor
.
err
)
{
flush
();
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录