Code example for ByteBuffer

Methods: slice

		this.token = token; 
		 * Take a slice so the caller can continue to change position/limit in 
		 * the original buffer. 
		this.chunkBuffer = chunkBuffer.slice(); 
	static private native void copy_to(long buffer, int index, long token, ByteBuffer chunkBuffer, int chunkOffset, int chunkLength); 
	protected void copy_to(long buffer, int index) throws CastleException 
		copy_to(buffer, index, token, chunkBuffer, chunkBuffer.position(), chunkBuffer.remaining());