[Biojava-dev] nio for io?

mark.schreiber at novartis.com mark.schreiber at novartis.com
Thu Jan 4 06:26:51 UTC 2007


OK , probably no gains to be made here then. Another good reason for 
people to upgrade to 1.5 or 1.6 if they have not already done so.

It may also explain why things slowed down when I used the converter in 
Channels. I was wrapping a Channel into something that already used one.

- Mark





Michael Heuer <heuermh at acm.org>
Sent by: biojava-dev-bounces at lists.open-bio.org
01/04/2007 02:02 PM

 
        To:     mark.schreiber at novartis.com
        cc:     biojava-dev at biojava.org
        Subject:        Re: [Biojava-dev] nio for io?


Mark Schreiber wrote:

> There has been some talk of Sun reprogramming normal java.io objects to
> use NIO internally, does anyone know if this has happened (if it has 
there
> is probably not much point in us looking into it much)?

I seem to remember the jdk release notes around 1.5 saying this was the
case.

Very unscientifically,

$ grep nio jdk1.6.0/src/java/io/*.java
ByteArrayOutputStream.java:     * default character set. The {@linkplain
java.nio.charset.CharsetDecoder}
ByteArrayOutputStream.java:     * the specified {@link
java.nio.charset.Charset charsetName}. The length of
ByteArrayOutputStream.java:     * java.nio.charset.CharsetDecoder} class
should be used when more control
ByteArrayOutputStream.java:     *                   {@linkplain
java.nio.charset.Charset </code>charset<code>}
Console.java:import java.nio.charset.Charset;
Console.java:import sun.nio.cs.StreamDecoder;
Console.java:import sun.nio.cs.StreamEncoder;
Console.java:    * {@link java.io.Reader#read(java.nio.CharBuffer)
read(java.nio.CharBuffer)}
File.java:     * {@link java.nio.channels.FileLock FileLock}
File.java:     * {@link java.nio.channels.FileLock FileLock}
FileInputStream.java:import java.nio.channels.FileChannel;
FileInputStream.java:import sun.nio.ch.FileChannelImpl;
FileInputStream.java:     * Returns the unique {@link
java.nio.channels.FileChannel FileChannel}
FileInputStream.java:     * <p> The initial {@link
java.nio.channels.FileChannel#position()
FileOutputStream.java:import java.nio.channels.FileChannel;
FileOutputStream.java:import sun.nio.ch.FileChannelImpl;
FileOutputStream.java:     * Returns the unique {@link
java.nio.channels.FileChannel FileChannel}
FileOutputStream.java:     * <p> The initial {@link
java.nio.channels.FileChannel#position()
InputStreamReader.java:import java.nio.charset.Charset;
InputStreamReader.java:import java.nio.charset.CharsetDecoder;
InputStreamReader.java:import sun.nio.cs.StreamDecoder;
InputStreamReader.java: * java.nio.charset.Charset <code>charset</code>}.
The charset that it uses
InputStreamReader.java: * @see java.nio.charset.Charset
InputStreamReader.java:     *         {@link java.nio.charset.Charset
</code>charset<code>}
InputStreamReader.java:     * @see java.nio.charset.Charset
OutputStreamWriter.java:import java.nio.charset.Charset;
OutputStreamWriter.java:import java.nio.charset.CharsetEncoder;
OutputStreamWriter.java:import sun.nio.cs.StreamEncoder;
OutputStreamWriter.java: * java.nio.charset.Charset <code>charset</code>}.
The charset that it uses
OutputStreamWriter.java: * The {@linkplain
java.nio.charset.CharsetEncoder} class should be used when more
OutputStreamWriter.java: * @see java.nio.charset.Charset
OutputStreamWriter.java:     *         {@link java.nio.charset.Charset
</code>charset<code>}
OutputStreamWriter.java:     * @see java.nio.charset.Charset
PrintStream.java:     * {@linkplain
java.nio.charset.Charset#defaultCharset() default charset}
PrintStream.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
PrintStream.java:     * java.nio.charset.Charset#defaultCharset() default
charset} for this
PrintStream.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
PrintWriter.java:     * java.nio.charset.Charset#defaultCharset() default
charset} for this
PrintWriter.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
PrintWriter.java:     * java.nio.charset.Charset#defaultCharset() default
charset} for this
PrintWriter.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
RandomAccessFile.java:import java.nio.channels.FileChannel;
RandomAccessFile.java:import sun.nio.ch.FileChannelImpl;
RandomAccessFile.java:     * java.nio.channels.FileChannel#force(boolean)
force(boolean)} method of
RandomAccessFile.java:     * the {@link java.nio.channels.FileChannel}
class, passing arguments of
RandomAccessFile.java:     * @see
java.nio.channels.FileChannel#force(boolean)
RandomAccessFile.java:     * Returns the unique {@link
java.nio.channels.FileChannel FileChannel}
RandomAccessFile.java:     * <p> The {@link
java.nio.channels.FileChannel#position()
Reader.java:    public int read(java.nio.CharBuffer target) throws
IOException {


$ grep nio jdk1.5.0_08/src/java/io/*.java
File.java:     * {@link java.nio.channels.FileLock FileLock}
File.java:     * {@link java.nio.channels.FileLock FileLock}
FileInputStream.java:import java.nio.channels.FileChannel;
FileInputStream.java:import sun.nio.ch.FileChannelImpl;
FileInputStream.java:     * Returns the unique {@link
java.nio.channels.FileChannel FileChannel}
FileInputStream.java:     * <p> The initial {@link
java.nio.channels.FileChannel#position()
FileOutputStream.java:import java.nio.channels.FileChannel;
FileOutputStream.java:import sun.nio.ch.FileChannelImpl;
FileOutputStream.java:     * Returns the unique {@link
java.nio.channels.FileChannel FileChannel}
FileOutputStream.java:     * <p> The initial {@link
java.nio.channels.FileChannel#position()
InputStreamReader.java:import java.nio.charset.Charset;
InputStreamReader.java:import java.nio.charset.CharsetDecoder;
InputStreamReader.java:import sun.nio.cs.StreamDecoder;
InputStreamReader.java: * java.nio.charset.Charset <code>charset</code>}.
The charset that it uses
InputStreamReader.java: * @see java.nio.charset.Charset
InputStreamReader.java:     *         {@link java.nio.charset.Charset
</code>charset<code>}
InputStreamReader.java:     * @see java.nio.charset.Charset
OutputStreamWriter.java:import java.nio.charset.Charset;
OutputStreamWriter.java:import java.nio.charset.CharsetEncoder;
OutputStreamWriter.java:import sun.nio.cs.StreamEncoder;
OutputStreamWriter.java: * java.nio.charset.Charset <code>charset</code>}.
The charset that it uses
OutputStreamWriter.java: * @see java.nio.charset.Charset
OutputStreamWriter.java:     *         {@link java.nio.charset.Charset
</code>charset<code>}
OutputStreamWriter.java:     * @see java.nio.charset.Charset
PrintStream.java:     * {@linkplain
java.nio.charset.Charset#defaultCharset default charset}
PrintStream.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
PrintStream.java:     * java.nio.charset.Charset#defaultCharset default
charset} for this
PrintStream.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
PrintWriter.java:     * java.nio.charset.Charset#defaultCharset default
charset} for this
PrintWriter.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
PrintWriter.java:     * java.nio.charset.Charset#defaultCharset default
charset} for this
PrintWriter.java:     *         The name of a supported {@linkplain
java.nio.charset.Charset
RandomAccessFile.java:import java.nio.channels.FileChannel;
RandomAccessFile.java:import sun.nio.ch.FileChannelImpl;
RandomAccessFile.java:     * java.nio.channels.FileChannel#force(boolean)
force(boolean)} method of
RandomAccessFile.java:     * the {@link java.nio.channels.FileChannel}
class, passing arguments of
RandomAccessFile.java:     * @see
java.nio.channels.FileChannel#force(boolean)
RandomAccessFile.java:     * Returns the unique {@link
java.nio.channels.FileChannel FileChannel}
RandomAccessFile.java:     * <p> The {@link
java.nio.channels.FileChannel#position()
Reader.java:    public int read(java.nio.CharBuffer target) throws
IOException {

:)

   michael

_______________________________________________
biojava-dev mailing list
biojava-dev at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biojava-dev






More information about the biojava-dev mailing list