/** * {@inheritDoc} */ @Override public void putDouble(double d) { prepareForAccess(8); if (componentCursor.getRemaining() >= 4) { componentCursor.putDouble(d); index += 8; } else { long l = Double.doubleToLongBits(d); putLong(l); } }
/** * {@inheritDoc} */ @Override public void putFloat(float f) { prepareForAccess(4); if (componentCursor.getRemaining() >= 4) { componentCursor.putFloat(f); index += 4; } else { int i = Float.floatToIntBits(f); putInt(i); } }
/** * {@inheritDoc} */ @Override public double getDouble() { prepareForAccess(8); if (componentCursor.getRemaining() >= 4) { double d = componentCursor.getDouble(); index += 8; return d; } else { long l = getLong(); return Double.longBitsToDouble(l); } }
/** * {@inheritDoc} */ @Override public ByteArray slice(int length) { CompositeByteArray slice = new CompositeByteArray(byteArrayFactory); int remaining = length; while (remaining > 0) { prepareForAccess(remaining); int componentSliceSize = Math.min(remaining, componentCursor.getRemaining()); ByteArray componentSlice = componentCursor.slice(componentSliceSize); slice.addLast(componentSlice); index += componentSliceSize; remaining -= componentSliceSize; } return slice; }
/** * {@inheritDoc} */ @Override public void get(IoBuffer bb) { while (bb.hasRemaining()) { int remainingBefore = bb.remaining(); prepareForAccess(remainingBefore); componentCursor.get(bb); int remainingAfter = bb.remaining(); // Advance index by actual amount got. int chunkSize = remainingBefore - remainingAfter; index += chunkSize; } }
/** * @inheritDoc */ public void put( IoBuffer bb ) { while ( bb.hasRemaining() ) { int remainingBefore = bb.remaining(); prepareForAccess( remainingBefore ); componentCursor.put( bb ); int remainingAfter = bb.remaining(); // Advance index by actual amount put. int chunkSize = remainingBefore - remainingAfter; index += chunkSize; } }
/** * {@inheritDoc} */ @Override public void put(IoBuffer bb) { while (bb.hasRemaining()) { int remainingBefore = bb.remaining(); prepareForAccess(remainingBefore); componentCursor.put(bb); int remainingAfter = bb.remaining(); // Advance index by actual amount put. int chunkSize = remainingBefore - remainingAfter; index += chunkSize; } }
/** * {@inheritDoc} */ @Override public void putFloat(float f) { prepareForAccess(4); if (componentCursor.getRemaining() >= 4) { componentCursor.putFloat(f); index += 4; } else { int i = Float.floatToIntBits(f); putInt(i); } }
/** * {@inheritDoc} */ @Override public float getFloat() { prepareForAccess(4); if (componentCursor.getRemaining() >= 4) { float f = componentCursor.getFloat(); index += 4; return f; } else { int i = getInt(); return Float.intBitsToFloat(i); } }
/** * {@inheritDoc} */ @Override public double getDouble() { prepareForAccess(8); if (componentCursor.getRemaining() >= 4) { double d = componentCursor.getDouble(); index += 8; return d; } else { long l = getLong(); return Double.longBitsToDouble(l); } }
/** * {@inheritDoc} */ @Override public void putDouble(double d) { prepareForAccess(8); if (componentCursor.getRemaining() >= 4) { componentCursor.putDouble(d); index += 8; } else { long l = Double.doubleToLongBits(d); putLong(l); } }
/** * {@inheritDoc} */ @Override public float getFloat() { prepareForAccess(4); if (componentCursor.getRemaining() >= 4) { float f = componentCursor.getFloat(); index += 4; return f; } else { int i = getInt(); return Float.intBitsToFloat(i); } }
/** * {@inheritDoc} */ @Override public void put(IoBuffer bb) { while (bb.hasRemaining()) { int remainingBefore = bb.remaining(); prepareForAccess(remainingBefore); componentCursor.put(bb); int remainingAfter = bb.remaining(); // Advance index by actual amount put. int chunkSize = remainingBefore - remainingAfter; index += chunkSize; } }
/** * {@inheritDoc} */ @Override public void get(IoBuffer bb) { while (bb.hasRemaining()) { int remainingBefore = bb.remaining(); prepareForAccess(remainingBefore); componentCursor.get(bb); int remainingAfter = bb.remaining(); // Advance index by actual amount got. int chunkSize = remainingBefore - remainingAfter; index += chunkSize; } }
/** * @inheritDoc */ public void put( byte b ) { prepareForAccess( 1 ); componentCursor.put( b ); index += 1; }
/** * @inheritDoc */ public byte get() { prepareForAccess( 1 ); byte b = componentCursor.get(); index += 1; return b; }
/** * {@inheritDoc} */ @Override public void put(byte b) { prepareForAccess(1); componentCursor.put(b); index += 1; }
/** * {@inheritDoc} */ @Override public byte get() { prepareForAccess(1); byte b = componentCursor.get(); index += 1; return b; }
/** * {@inheritDoc} */ @Override public void put(byte b) { prepareForAccess(1); componentCursor.put(b); index += 1; }
/** * {@inheritDoc} */ @Override public byte get() { prepareForAccess(1); byte b = componentCursor.get(); index += 1; return b; }