diff --git a/src/main/java/java/nio/ByteBuffer.java b/src/main/java/java/nio/ByteBuffer.java index 6dff8854..356dd33d 100644 --- a/src/main/java/java/nio/ByteBuffer.java +++ b/src/main/java/java/nio/ByteBuffer.java @@ -955,4 +955,9 @@ public int getElementType() { public boolean isReadOnly() { return false; } + + @Override + public final byte[] array() { + return (byte[]) super.array(); + } } diff --git a/src/main/java/java/nio/CharBuffer.java b/src/main/java/java/nio/CharBuffer.java index 4314e7e1..f87a436e 100644 --- a/src/main/java/java/nio/CharBuffer.java +++ b/src/main/java/java/nio/CharBuffer.java @@ -490,4 +490,9 @@ public int read (CharBuffer target) throws IOException { target.put(chars); return result; } + + @Override + public final char[] array() { + return (char[]) super.array(); + } } diff --git a/src/main/java/java/nio/DoubleBuffer.java b/src/main/java/java/nio/DoubleBuffer.java index 89c6618e..c6c2777f 100644 --- a/src/main/java/java/nio/DoubleBuffer.java +++ b/src/main/java/java/nio/DoubleBuffer.java @@ -332,4 +332,9 @@ public String toString () { buf.append(limit()); return buf.toString(); } + + @Override + public final double[] array() { + return (double[]) super.array(); + } } diff --git a/src/main/java/java/nio/FloatBuffer.java b/src/main/java/java/nio/FloatBuffer.java index 16340935..bb2d2b71 100644 --- a/src/main/java/java/nio/FloatBuffer.java +++ b/src/main/java/java/nio/FloatBuffer.java @@ -391,4 +391,9 @@ public int getElementType() { public boolean isReadOnly() { return false; } + + @Override + public final float[] array() { + return (float[]) super.array(); + } } diff --git a/src/main/java/java/nio/IntBuffer.java b/src/main/java/java/nio/IntBuffer.java index 20f04ad7..31d5e17b 100644 --- a/src/main/java/java/nio/IntBuffer.java +++ b/src/main/java/java/nio/IntBuffer.java @@ -395,4 +395,9 @@ public int getElementType() { public boolean isReadOnly() { return false; } + + @Override + public final int[] array() { + return (int[]) super.array(); + } } diff --git a/src/main/java/java/nio/LongBuffer.java b/src/main/java/java/nio/LongBuffer.java index 728e8172..54001196 100644 --- a/src/main/java/java/nio/LongBuffer.java +++ b/src/main/java/java/nio/LongBuffer.java @@ -330,4 +330,9 @@ public String toString () { buf.append(limit()); return buf.toString(); } + + @Override + public final long[] array() { + return (long[]) super.array(); + } } diff --git a/src/main/java/java/nio/ShortBuffer.java b/src/main/java/java/nio/ShortBuffer.java index 9da1bf84..351dba76 100644 --- a/src/main/java/java/nio/ShortBuffer.java +++ b/src/main/java/java/nio/ShortBuffer.java @@ -388,4 +388,9 @@ public int getElementType() { public boolean isReadOnly() { return false; } + + @Override + public final short[] array() { + return (short[]) super.array(); + } }