Lines Matching defs:byteBuffer
35 private final ByteBuffer byteBuffer;
37 static ShortBuffer asShortBuffer(ByteBuffer byteBuffer) {
38 ByteBuffer slice = byteBuffer.slice();
39 slice.order(byteBuffer.order());
43 private ByteBufferAsShortBuffer(ByteBuffer byteBuffer) {
44 super(byteBuffer.capacity() / SizeOf.SHORT);
45 this.byteBuffer = byteBuffer;
46 this.byteBuffer.clear();
47 this.effectiveDirectAddress = byteBuffer.effectiveDirectAddress;
52 ByteBufferAsShortBuffer buf = new ByteBufferAsShortBuffer(byteBuffer.asReadOnlyBuffer());
56 buf.byteBuffer.order = byteBuffer.order;
62 if (byteBuffer.isReadOnly()) {
65 byteBuffer.limit(limit * SizeOf.SHORT);
66 byteBuffer.position(position * SizeOf.SHORT);
67 byteBuffer.compact();
68 byteBuffer.clear();
77 ByteBuffer bb = byteBuffer.duplicate().order(byteBuffer.order());
90 return byteBuffer.getShort(position++ * SizeOf.SHORT);
96 return byteBuffer.getShort(index * SizeOf.SHORT);
101 byteBuffer.limit(limit * SizeOf.SHORT);
102 byteBuffer.position(position * SizeOf.SHORT);
103 if (byteBuffer instanceof DirectByteBuffer) {
104 ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, shortCount);
106 ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, shortCount);
114 return byteBuffer.isDirect();
119 return byteBuffer.isReadOnly();
124 return byteBuffer.order();
144 byteBuffer.putShort(position++ * SizeOf.SHORT, c);
151 byteBuffer.putShort(index * SizeOf.SHORT, c);
157 byteBuffer.limit(limit * SizeOf.SHORT);
158 byteBuffer.position(position * SizeOf.SHORT);
159 if (byteBuffer instanceof DirectByteBuffer) {
160 ((DirectByteBuffer) byteBuffer).put(src, srcOffset, shortCount);
162 ((ByteArrayBuffer) byteBuffer).put(src, srcOffset, shortCount);
170 byteBuffer.limit(limit * SizeOf.SHORT);
171 byteBuffer.position(position * SizeOf.SHORT);
172 ByteBuffer bb = byteBuffer.slice().order(byteBuffer.order());
174 byteBuffer.clear();