diff options
Diffstat (limited to 'libjava/java/nio/ShortViewBufferImpl.java')
| -rw-r--r-- | libjava/java/nio/ShortViewBufferImpl.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libjava/java/nio/ShortViewBufferImpl.java b/libjava/java/nio/ShortViewBufferImpl.java index b217f1cb553..04d778578b0 100644 --- a/libjava/java/nio/ShortViewBufferImpl.java +++ b/libjava/java/nio/ShortViewBufferImpl.java @@ -45,12 +45,21 @@ class ShortViewBufferImpl extends ShortBuffer private ByteBuffer bb; private boolean readOnly; private ByteOrder endian; + + ShortViewBufferImpl (ByteBuffer bb, int capacity) + { + super (capacity, capacity, 0, -1); + this.bb = bb; + this.offset = bb.position(); + this.readOnly = bb.isReadOnly(); + this.endian = bb.order(); + } public ShortViewBufferImpl (ByteBuffer bb, int offset, int capacity, int limit, int position, int mark, boolean readOnly, ByteOrder endian) { - super (limit >> 1, limit >> 1, position >> 1, mark >> 1); + super (capacity, limit, position, mark); this.bb = bb; this.offset = offset; this.readOnly = readOnly; |

