diff options
| author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-02 11:17:40 +0000 |
|---|---|---|
| committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-02 11:17:40 +0000 |
| commit | 84ee71618c6620b9a1787f5657e98342d748eaf1 (patch) | |
| tree | 74653b76448900743d8783089006138f40c280d3 /libjava/java/nio/channels/FileChannelImpl.java | |
| parent | f815eb0fb2d9eea87e4e38412d5e660b32e84cac (diff) | |
| download | ppe42-gcc-84ee71618c6620b9a1787f5657e98342d748eaf1.tar.gz ppe42-gcc-84ee71618c6620b9a1787f5657e98342d748eaf1.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70102 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/nio/channels/FileChannelImpl.java')
| -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 9d610551a37..85113a0287b 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); } |

