diff options
author | Bryce McKinlay <bryce@mckinlay.net.nz> | 2003-09-24 05:38:36 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2003-09-24 06:38:36 +0100 |
commit | 9b7fe786e1287f830952706fbd9ddb39077d70a9 (patch) | |
tree | e590f9d618533504ebc1020d0b891654538a1dff /libjava/gnu/java/net/PlainSocketImpl.java | |
parent | b9f2972f1ea065c2ceb8bc0d1cab7636dc2406ae (diff) | |
download | gcc-9b7fe786e1287f830952706fbd9ddb39077d70a9.zip gcc-9b7fe786e1287f830952706fbd9ddb39077d70a9.tar.gz gcc-9b7fe786e1287f830952706fbd9ddb39077d70a9.tar.bz2 |
PlainSocketImpl.java (read): Remove declaration.
* gnu/java/net/PlainSocketImpl.java (read): Remove declaration.
(write): Likewise.
(SocketInputStream, SocketOutputStream): Declare `read' and `write'
native. Remove implementations which called back into
PlainSocketImpl.
Remove unneccessary overridden methods.
* gnu/java/net/natPlainSocketImplNoNet.cc (read): Move
implementation
to inner class PlainSocketImpl.SocketInputStream.
(write): Likewise.
* gnu/java/net/natPlainSocketImplPosix.cc: As above.
* gnu/java/net/natPlainSocketImplWin32.cc: As above.
* gnu/java/net/SocketInputStream.java: Remove unused file.
* gnu/java/net/SocketOutputStream.java: Likewise.
* Makefile.am: Build CNI headers for PlainSocketImpl.SocketInputStream
and SocketOutputStream.
* Makefile.in: Rebuilt.
From-SVN: r71724
Diffstat (limited to 'libjava/gnu/java/net/PlainSocketImpl.java')
-rw-r--r-- | libjava/gnu/java/net/PlainSocketImpl.java | 78 |
1 files changed, 12 insertions, 66 deletions
diff --git a/libjava/gnu/java/net/PlainSocketImpl.java b/libjava/gnu/java/net/PlainSocketImpl.java index 182f357f..3edb974 100644 --- a/libjava/gnu/java/net/PlainSocketImpl.java +++ b/libjava/gnu/java/net/PlainSocketImpl.java @@ -271,32 +271,6 @@ public final class PlainSocketImpl extends SocketImpl protected native void sendUrgentData(int data) throws IOException; - native int read() throws IOException; - - /** - * Internal method used by SocketInputStream for reading data from - * the connection. Reads up to len bytes of data into the buffer - * buf starting at offset bytes into the buffer. - * - * @return The actual number of bytes read or -1 if end of stream. - * - * @exception IOException If an error occurs - */ - native int read(byte[] buffer, int offset, int count) - throws IOException; - - native void write(int c) throws IOException; - - /** - * Internal method used by SocketOuputStream for writing data to - * the connection. Writes up to len bytes of data from the buffer - * buf starting at offset bytes into the buffer. - * - * @exception IOException If an error occurs - */ - native void write(byte[] buffer, int offset, int count) - throws IOException; - /** * Returns an InputStream object for reading from this socket. This will * be an instance of SocketInputStream. @@ -334,13 +308,14 @@ public final class PlainSocketImpl extends SocketImpl * * @author Nic Ferrier <nferrier@tapsellferrier.co.uk> */ - class SocketInputStream + final class SocketInputStream extends InputStream { - SocketInputStream() - { - } - + public native int read() throws IOException; + + public native int read(byte[] buffer, int offset, int length) + throws IOException; + public final void close() throws IOException { PlainSocketImpl.this.close(); @@ -350,52 +325,23 @@ public final class PlainSocketImpl extends SocketImpl { return PlainSocketImpl.this.available(); } - - public final int read() throws IOException - { - return PlainSocketImpl.this.read(); - } - - public final int read(byte[] buffer, int offset, int length) - throws IOException - { - return PlainSocketImpl.this.read(buffer, offset, length); - } - - public final int read(byte[] buffer) - throws IOException - { - return PlainSocketImpl.this.read(buffer, 0, buffer.length); - } } /** A stream which writes to the socket implementation. * * @author Nic Ferrier <nferrier@tapsellferrier.co.uk> */ - class SocketOutputStream + final class SocketOutputStream extends OutputStream { - public final void close() throws IOException - { - PlainSocketImpl.this.close(); - } + public native void write(int c) throws IOException; - public final void write(int c) throws IOException - { - PlainSocketImpl.this.write(c); - } + public native void write(byte[] buffer, int offset, int length) + throws IOException; - public final void write(byte[] buffer, int offset, int length) - throws IOException + public void close() throws IOException { - PlainSocketImpl.this.write(buffer, offset, length); - } - - public final void write(byte[] buffer) - throws IOException - { - PlainSocketImpl.this.write(buffer, 0, buffer.length); + PlainSocketImpl.this.close(); } } } |