diff options
author | Michael Koch <konqueror@gmx.de> | 2003-08-02 11:17:40 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-08-02 11:17:40 +0000 |
commit | 7318eb21d1fc8ae39dae0e6c4f7c3da8f5ae5865 (patch) | |
tree | 74653b76448900743d8783089006138f40c280d3 /libjava/java/nio/channels | |
parent | 2937079664a6145b45cc217f2fe4bafa83027bdd (diff) | |
download | gcc-7318eb21d1fc8ae39dae0e6c4f7c3da8f5ae5865.zip gcc-7318eb21d1fc8ae39dae0e6c4f7c3da8f5ae5865.tar.gz gcc-7318eb21d1fc8ae39dae0e6c4f7c3da8f5ae5865.tar.bz2 |
2003-08-02 Michael Koch <konqueror@gmx.de>
* java/nio/ByteBufferImpl.java
(getChar): Check remaining bytes, fixed comment about endianess.
(putChar): Likewise.
(getShort): Likewise.
(putShort): Likewise.
(getInt): Check remaining bytes, fixed conversion, fixed comment about
endianess.
(putInt): Likewise.
(getLong): Likewise.
(putLong): Likewise.
(getFloat): Likewise.
(putFloat): Likewise.
(getDouble): Likewise.
(putDouble): Likewise.
* java/nio/DirectByteBufferImpl.java
(getChar): Wrapped code, fixed comment about endianess.
(putchar): Likewise.
(getShort): Likewise.
(putShort): Likewise.
(getInt): Fixed conversion, fixed comment about endianess.
(putInt): Likewise.
(getLong): Likewise.
(putLong): Likewise.
(getFloat): Likewise.
(putFloat): Likewise.
(getDouble): Likewise.
(putDouble): Likewise.
* java/nio/MappedByteBufferImpl.java
(compact): Implemented.
(getChar): Implemented.
(putChar): Implemented.
(getDouble): Implemented.
(putdouble): Implemented.
(getFloat): Implemented.
(putFloat): Implemented.
(getInt): Implemented.
(putInt): Implemented.
(getLong): Implemented.
(putLong): Implemented.
(getShort): Implemented.
(putShort): Implemented.
* java/nio/channels/FileChannelImpl.java
(read): Set position where to access file.
(write): Likewise.
(transferTo): Flip buffer after read and before write.
(transferFrom): Likewise.
From-SVN: r70102
Diffstat (limited to 'libjava/java/nio/channels')
-rw-r--r-- | libjava/java/nio/channels/FileChannelImpl.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libjava/java/nio/channels/FileChannelImpl.java b/libjava/java/nio/channels/FileChannelImpl.java index 9d61055..85113a0 100644 --- a/libjava/java/nio/channels/FileChannelImpl.java +++ b/libjava/java/nio/channels/FileChannelImpl.java @@ -146,6 +146,7 @@ public class FileChannelImpl extends FileChannel long oldPosition; oldPosition = implPosition (); + position (position); result = implRead (dst); implPosition (oldPosition); @@ -208,6 +209,7 @@ public class FileChannelImpl extends FileChannel long oldPosition; oldPosition = implPosition (); + position (position); result = implWrite (src); implPosition (oldPosition); @@ -298,6 +300,7 @@ public class FileChannelImpl extends FileChannel // XXX: count needs to be casted from long to int. Dataloss ? ByteBuffer buffer = ByteBuffer.allocate ((int) count); read (buffer, position); + buffer.flip(); return target.write (buffer); } @@ -317,6 +320,7 @@ public class FileChannelImpl extends FileChannel // XXX: count needs to be casted from long to int. Dataloss ? ByteBuffer buffer = ByteBuffer.allocate ((int) count); src.read (buffer); + buffer.flip(); return write (buffer, position); } |