View | Details | Raw Unified | Return to bug 1180
Collapse All | Expand All

(-)a/src/java/com/jogamp/common/nio/Buffers.java (-7 / +7 lines)
Lines 80-86 public class Buffers { Link Here
80
    }
80
    }
81
81
82
    public static ByteBuffer newDirectByteBuffer(final byte[] values, final int offset, final int length) {
82
    public static ByteBuffer newDirectByteBuffer(final byte[] values, final int offset, final int length) {
83
        return (ByteBuffer)newDirectByteBuffer(length).put(values, offset, length).rewind();
83
        return (ByteBuffer)newDirectByteBuffer(length).put(values, offset, length).clear();
84
    }
84
    }
85
85
86
    public static ByteBuffer newDirectByteBuffer(final byte[] values, final int offset) {
86
    public static ByteBuffer newDirectByteBuffer(final byte[] values, final int offset) {
Lines 101-107 public class Buffers { Link Here
101
    }
101
    }
102
102
103
    public static DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset, final int length) {
103
    public static DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset, final int length) {
104
        return (DoubleBuffer)newDirectDoubleBuffer(length).put(values, offset, length).rewind();
104
        return (DoubleBuffer)newDirectDoubleBuffer(length).put(values, offset, length).clear();
105
    }
105
    }
106
106
107
    public static DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset) {
107
    public static DoubleBuffer newDirectDoubleBuffer(final double[] values, final int offset) {
Lines 122-128 public class Buffers { Link Here
122
    }
122
    }
123
123
124
    public static FloatBuffer newDirectFloatBuffer(final float[] values, final int offset, final int length) {
124
    public static FloatBuffer newDirectFloatBuffer(final float[] values, final int offset, final int length) {
125
        return (FloatBuffer)newDirectFloatBuffer(length).put(values, offset, length).rewind();
125
        return (FloatBuffer)newDirectFloatBuffer(length).put(values, offset, length).clear();
126
    }
126
    }
127
127
128
    public static FloatBuffer newDirectFloatBuffer(final float[] values, final int offset) {
128
    public static FloatBuffer newDirectFloatBuffer(final float[] values, final int offset) {
Lines 143-149 public class Buffers { Link Here
143
    }
143
    }
144
144
145
    public static IntBuffer newDirectIntBuffer(final int[] values, final int offset, final int length) {
145
    public static IntBuffer newDirectIntBuffer(final int[] values, final int offset, final int length) {
146
        return (IntBuffer)newDirectIntBuffer(length).put(values, offset, length).rewind();
146
        return (IntBuffer)newDirectIntBuffer(length).put(values, offset, length).clear();
147
    }
147
    }
148
148
149
    public static IntBuffer newDirectIntBuffer(final int[] values, final int offset) {
149
    public static IntBuffer newDirectIntBuffer(final int[] values, final int offset) {
Lines 164-170 public class Buffers { Link Here
164
    }
164
    }
165
165
166
    public static LongBuffer newDirectLongBuffer(final long[] values, final int offset, final int length) {
166
    public static LongBuffer newDirectLongBuffer(final long[] values, final int offset, final int length) {
167
        return (LongBuffer)newDirectLongBuffer(length).put(values, offset, length).rewind();
167
        return (LongBuffer)newDirectLongBuffer(length).put(values, offset, length).clear();
168
    }
168
    }
169
169
170
    public static LongBuffer newDirectLongBuffer(final long[] values, final int offset) {
170
    public static LongBuffer newDirectLongBuffer(final long[] values, final int offset) {
Lines 185-191 public class Buffers { Link Here
185
    }
185
    }
186
186
187
    public static ShortBuffer newDirectShortBuffer(final short[] values, final int offset, final int length) {
187
    public static ShortBuffer newDirectShortBuffer(final short[] values, final int offset, final int length) {
188
        return (ShortBuffer)newDirectShortBuffer(length).put(values, offset, length).rewind();
188
        return (ShortBuffer)newDirectShortBuffer(length).put(values, offset, length).clear();
189
    }
189
    }
190
190
191
    public static ShortBuffer newDirectShortBuffer(final short[] values, final int offset) {
191
    public static ShortBuffer newDirectShortBuffer(final short[] values, final int offset) {
Lines 206-212 public class Buffers { Link Here
206
    }
206
    }
207
207
208
    public static CharBuffer newDirectCharBuffer(final char[] values, final int offset, final int length) {
208
    public static CharBuffer newDirectCharBuffer(final char[] values, final int offset, final int length) {
209
        return (CharBuffer)newDirectCharBuffer(length).put(values, offset, length).rewind();
209
        return (CharBuffer)newDirectCharBuffer(length).put(values, offset, length).clear();
210
    }
210
    }
211
211
212
    public static CharBuffer newDirectCharBuffer(final char[] values, final int offset) {
212
    public static CharBuffer newDirectCharBuffer(final char[] values, final int offset) {

Return to bug 1180