Code example for ByteBuffer

Methods: slice

0
		this(key, collectionId, keyBuffer, valueBuffer, null);
	} 
	 
	public ReplaceRequest(Key key, int collectionId, ByteBuffer keyBuffer, ByteBuffer valueBuffer, Long timestamp) throws CastleException
	{ 
		this(collectionId, keyBuffer, copyKey(key, keyBuffer), valueBuffer, timestamp);
	} 
	 
	public ReplaceRequest(int collectionId, ByteBuffer keyBuffer, int keyLength, ByteBuffer valueBuffer)
	{ 
		this(collectionId, keyBuffer, keyLength, valueBuffer, null);
	} 
	 
	public ReplaceRequest(int collectionId, ByteBuffer keyBuffer, int keyLength, ByteBuffer valueBuffer, Long timestamp)
	{ 
		this.collectionId = collectionId;
		this.keyLength = keyLength;
		/* 
		 * Take a slice so the caller can continue to change position/limit in 
		 * the original buffer. 
		 */ 
		this.keyBuffer = keyBuffer.slice();
		this.valueBuffer = valueBuffer.slice();
		this.timestamp = timestamp;
	} 
 
	static private native void copy_to(long buffer, int index, int collectionId, ByteBuffer keyBuffer, int keyOffset,