[Biojava-dev] nio for io?

Michael Heuer heuermh at acm.org
Thu Jan 4 06:02:55 UTC 2007


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




More information about the biojava-dev mailing list