[multiple changes]
2004-04-20 Jeroen Frijters <jeroen@frijters.net> * java/io/FileDescriptor.java: (FileDescriptor) Added public constructor. (valid) Added null check. 2004-04-20 Guilhem Lavaux <guilhem@kaffe.org> Reported by Nektarios Papadopoulos <npapadop@inaccessnetworks.com> * java/io/FileOutputStream.java (FileOutputStream) Reorganized constructors. Constructors now check whether the given path is directory. From-SVN: r80901
This commit is contained in:
@@ -83,6 +83,14 @@ public final class FileDescriptor
|
||||
/**
|
||||
* This method is used to initialize an invalid FileDescriptor object.
|
||||
*/
|
||||
public FileDescriptor()
|
||||
{
|
||||
channel = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to initialize a FileDescriptor object.
|
||||
*/
|
||||
FileDescriptor(ByteChannel channel)
|
||||
{
|
||||
this.channel = channel;
|
||||
@@ -125,6 +133,6 @@ public final class FileDescriptor
|
||||
*/
|
||||
public boolean valid ()
|
||||
{
|
||||
return channel.isOpen();
|
||||
return channel != null && channel.isOpen();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user