[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Patch for discussion: The big NIO merge
From: |
Jeroen Frijters |
Subject: |
RE: Patch for discussion: The big NIO merge |
Date: |
Tue, 6 Apr 2004 10:08:05 +0200 |
Michael Koch wrote:
> Here is a little NIO patch for classpath. Its mainly to merge with
> current libgcj to get differences smaller. It uses java.nio now
> internally in java.io to access files. This surely needs a NEWS item
> for the next release.
>
> Any comments ? Okay to commit ?
Looks great! I a few small comments/requests.
Would you consider renaming gnu.java.nio.channels.FileChannelImpl to
gnu.java.nio.channels.VMFileChannel? I'm almost certainly going to need
to replace it (unless we introduce another layer VMFileChannelImpl, but
that seems pointless).
Why are some of the fields (e.g. owner in DirectByteBufferImpl)
protected in a final class?
This looks a bit odd:
+ if (channel instanceof FileChannel)
+ {
+ try
+ {
+ ((FileChannel) channel).force(true);
+ }
+ catch (IOException ex)
+ {
+ if (ex instanceof SyncFailedException)
+ throw (SyncFailedException) ex;
+ else
+ throw new SyncFailedException(ex.getMessage());
+ }
+ }
Why not simply do:
+ catch (SyncFailedException ex)
+ {
+ throw ex;
+ }
+ catch (IOException ex)
+ {
+ throw (SyncFailedException)new
SyncFailedException().initCause(ex);
+ }
Would you please consider moving newInputStream/newOutputStream from
java.nio.channels.Channels to java.nio.channels.VMChannels?
Thanks!
Regards,
Jeroen