boolean needConversion(int index) { IntBuffer readOnly = conversions[index].asReadOnlyBuffer(); readOnly.rewind(); int i = 0; while (readOnly.hasRemaining()) { if (i != readOnly.get()) { return true; } i++; } return false; }
int ret = currIndex; ++currIndex; if (dimConversions.hasRemaining()) { currVal = dimConversions.get(); } else {
int ret = currIndex; ++currIndex; if (dimConversions.hasRemaining()) { currVal = dimConversions.get(); } else {
value.rewind(); int ctr = 0; while (value.hasRemaining()) { ctr++; buf.append(value.get());
@Override public int hashCode() { IntBuffer intbuf = ByteBuffer.wrap(bytes).asIntBuffer(); int result = intbuf.get(); while (intbuf.hasRemaining()) { result ^= intbuf.get(); } return result; }
public void padZeros() { while (mIntBuffer.hasRemaining()) mIntBuffer.put(0); }
@Override protected void serialize(final IntBuffer input, final ArrayNode output) { while (input.hasRemaining()) output.add(input.get()); } }
public static void main(String[] args) { ByteBuffer bb = ByteBuffer.allocate(BSIZE); IntBuffer ib = bb.asIntBuffer(); // Store an array of int: ib.put(new int[]{ 11, 42, 47, 99, 143, 811, 1016 }); // Absolute location read and write: System.out.println(ib.get(3)); ib.put(3, 1811); // Setting a new limit before rewinding the buffer. ib.flip(); while(ib.hasRemaining()) { int i = ib.get(); System.out.println(i); } } }
@Override public void appendBuffer(IntBuffer buffer, IntBuffer dataToAppend) { int[] temp = new int[Math.min(COPY_BLOCK_SIZE, dataToAppend.remaining())]; while (dataToAppend.hasRemaining()) { int nrObBytes = Math.min(temp.length, dataToAppend.remaining()); dataToAppend.get(temp, 0, nrObBytes); buffer.put(temp, 0, nrObBytes); } }
@Override public void appendBuffer(IntBuffer buffer, IntBuffer dataToAppend) { int[] temp = new int[Math.min(COPY_BLOCK_SIZE, dataToAppend.remaining())]; while (dataToAppend.hasRemaining()) { int nrObBytes = Math.min(temp.length, dataToAppend.remaining()); dataToAppend.get(temp, 0, nrObBytes); buffer.put(temp, 0, nrObBytes); } }
@Override String join(TypedArrayObject typedArray, String separator, StrBuilder r) { IntBuffer data = asIntBuffer(typedArray); if (data.hasRemaining()) { while (true) { r.append(data.get()); if (!data.hasRemaining()) break; r.append(separator); } } return r.toString(); }
boolean needConversion(int index) { IntBuffer readOnly = conversions[index].asReadOnlyBuffer(); readOnly.rewind(); int i = 0; while (readOnly.hasRemaining()) { if (i != readOnly.get()) { return true; } i++; } return false; }
/** * Put (write) glyph into glyph output buffer. * @param glyph to write * @param a character association that applies to glyph * @param predication a predication value to add to association A if predications enabled */ public void putGlyph(int glyph, CharAssociation a, Object predication) { if (!ogb.hasRemaining()) { ogb = growBuffer(ogb); } ogb.put(glyph); if (predications && (predication != null)) { a.setPredication(feature, predication); } oal.add(a); }
boolean needConversion(int index) { IntBuffer readOnly = conversions[index].asReadOnlyBuffer(); readOnly.rewind(); int i = 0; while (readOnly.hasRemaining()) { if (i != readOnly.get()) { return true; } i++; } return false; }
@Override String join(TypedArrayObject typedArray, String separator, StrBuilder r) { IntBuffer data = asIntBuffer(typedArray); if (data.hasRemaining()) { while (true) { r.append(Integer.toUnsignedLong(data.get())); if (!data.hasRemaining()) break; r.append(separator); } } return r.toString(); }
@Override public String toString() { String retVal = "Size of the suffix array: " + this.size + "\n"; int rank = 0; while (indices.hasRemaining()) { int index = indices.get(); int lcp = this.neighboringLcps.get(rank); retVal += rank + "\t" + index + "\t" + lcp + "\t" + sequence.toString(factory.makeSuffix(index).getSequence()) + "\n"; rank++; } indices.rewind(); // reset marks after iteration neighboringLcps.rewind(); return retVal; }
/** * * @param samples * @param localSampleRate * @return * @since Oct 28, 2014 */ public SoundTexture newSoundTexture(final IntBuffer samples, final int localSampleRate){ final FloatBuffer fb = FloatBuffer.allocate(samples.remaining()); fb.clear(); while(samples.hasRemaining()){ fb.put((float)((double)samples.get()/(double)Integer.MAX_VALUE)); } fb.clear(); return newSoundTexture(fb,localSampleRate); }//end newSoundTexture(...)
@Override public void remove() { throw new UnsupportedOperationException(); }
@Override public void remove() { throw new UnsupportedOperationException(); }
public IntBuffer getConversionBuffer() { if (currIndex != conversionBuf.limit() || conversionBuf.hasRemaining()) { throw new ISE( "Asked for incomplete buffer. currIndex[%,d] != buf.limit[%,d]", currIndex, conversionBuf.limit() ); } return (IntBuffer) conversionBuf.asReadOnlyBuffer().rewind(); } }