Class JBuffers
Some operations for Java NIO buffers manipulation in the same manner as array operations from
JArrays and java.util.Arrays classes.
This class cannot be instantiated.
- Author:
- Daniel Alievsky
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidabsDiffOfByteArrayAndBuffer(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.static voidabsDiffOfCharArrayAndBuffer(char[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.static voidabsDiffOfDoubleArrayAndBuffer(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.static voidabsDiffOfFloatArrayAndBuffer(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.static voidabsDiffOfIntArrayAndBuffer(int[] dest, int destPos, IntBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src[srcPos+i]|.static voidabsDiffOfLongArrayAndBuffer(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.static voidabsDiffOfShortArrayAndBuffer(short[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.static voidaddByteBufferToArray(double[] dest, int destPos, ByteBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFF)*mult.static voidaddByteBufferToArray(int[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFF).static voidaddCharBufferToArray(double[] dest, int destPos, CharBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.static voidaddCharBufferToArray(int[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).static voidaddDoubleBufferToArray(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.static voidaddDoubleBufferToArray(int[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).static voidaddFloatBufferToArray(double[] dest, int destPos, FloatBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.static voidaddFloatBufferToArray(int[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).static voidaddIntBufferToArray(double[] dest, int destPos, IntBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.static voidaddIntBufferToArray(int[] dest, int destPos, IntBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).static voidaddLongBufferToArray(double[] dest, int destPos, LongBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.static voidaddLongBufferToArray(int[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).static voidaddShortBufferToArray(double[] dest, int destPos, ShortBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFFFF)*mult.static voidaddShortBufferToArray(int[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFFFF).static voidcopyByteBuffer(ByteBuffer dest, int destPos, ByteBuffer src, int srcPos, int count) Copies count byte elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyByteBuffer(ByteBuffer dest, int destPos, ByteBuffer src, int srcPos, int count, boolean reverseOrder) Copies count byte elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidcopyCharBuffer(CharBuffer dest, int destPos, CharBuffer src, int srcPos, int count) Copies count char elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyCharBuffer(CharBuffer dest, int destPos, CharBuffer src, int srcPos, int count, boolean reverseOrder) Copies count char elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidcopyDoubleBuffer(DoubleBuffer dest, int destPos, DoubleBuffer src, int srcPos, int count) Copies count double elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyDoubleBuffer(DoubleBuffer dest, int destPos, DoubleBuffer src, int srcPos, int count, boolean reverseOrder) Copies count double elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidcopyFloatBuffer(FloatBuffer dest, int destPos, FloatBuffer src, int srcPos, int count) Copies count float elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyFloatBuffer(FloatBuffer dest, int destPos, FloatBuffer src, int srcPos, int count, boolean reverseOrder) Copies count float elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidcopyIntBuffer(IntBuffer dest, int destPos, IntBuffer src, int srcPos, int count) Copies count int elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyIntBuffer(IntBuffer dest, int destPos, IntBuffer src, int srcPos, int count, boolean reverseOrder) Copies count int elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidcopyLongBuffer(LongBuffer dest, int destPos, LongBuffer src, int srcPos, int count) Copies count long elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyLongBuffer(LongBuffer dest, int destPos, LongBuffer src, int srcPos, int count, boolean reverseOrder) Copies count long elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidcopyShortBuffer(ShortBuffer dest, int destPos, ShortBuffer src, int srcPos, int count) Copies count short elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index.static voidcopyShortBuffer(ShortBuffer dest, int destPos, ShortBuffer src, int srcPos, int count, boolean reverseOrder) Copies count short elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.static voidfillByteBuffer(ByteBuffer dest, int destPos, int count, byte value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static voidfillCharBuffer(CharBuffer dest, int destPos, int count, char value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static voidfillDoubleBuffer(DoubleBuffer dest, int destPos, int count, double value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static voidfillFloatBuffer(FloatBuffer dest, int destPos, int count, float value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static voidfillIntBuffer(IntBuffer dest, int destPos, int count, int value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static voidfillLongBuffer(LongBuffer dest, int destPos, int count, long value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static voidfillShortBuffer(ShortBuffer dest, int destPos, int count, short value) Fills count elements in the dest buffer, starting from the element #destPos, by the specified value.static intindexOfByte(ByteBuffer buffer, int lowIndex, int highIndex, byte value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intindexOfChar(CharBuffer buffer, int lowIndex, int highIndex, char value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intindexOfDouble(DoubleBuffer buffer, int lowIndex, int highIndex, double value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intindexOfFloat(FloatBuffer buffer, int lowIndex, int highIndex, float value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intindexOfInt(IntBuffer buffer, int lowIndex, int highIndex, int value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intindexOfLong(LongBuffer buffer, int lowIndex, int highIndex, long value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intindexOfShort(ShortBuffer buffer, int lowIndex, int highIndex, short value) Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfByte(ByteBuffer buffer, int lowIndex, int highIndex, byte value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfChar(CharBuffer buffer, int lowIndex, int highIndex, char value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfDouble(DoubleBuffer buffer, int lowIndex, int highIndex, double value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfFloat(FloatBuffer buffer, int lowIndex, int highIndex, float value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfInt(IntBuffer buffer, int lowIndex, int highIndex, int value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfLong(LongBuffer buffer, int lowIndex, int highIndex, long value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static intlastIndexOfShort(ShortBuffer buffer, int lowIndex, int highIndex, short value) Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.static voidmaxByteArrayAndBuffer(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidmaxCharArrayAndBuffer(char[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidmaxDoubleArrayAndBuffer(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidmaxFloatArrayAndBuffer(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidmaxIntArrayAndBuffer(int[] dest, int destPos, IntBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidmaxLongArrayAndBuffer(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidmaxShortArrayAndBuffer(short[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminByteArrayAndBuffer(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminCharArrayAndBuffer(char[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminDoubleArrayAndBuffer(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminFloatArrayAndBuffer(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminIntArrayAndBuffer(int[] dest, int destPos, IntBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminLongArrayAndBuffer(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidminShortArrayAndBuffer(short[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.static voidsubtractByteBufferFromArray(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidsubtractCharBufferFromArray(char[] dest, int destPos, CharBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidsubtractDoubleBufferFromArray(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidsubtractFloatBufferFromArray(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidsubtractIntBufferFromArray(int[] dest, int destPos, IntBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidsubtractLongBufferFromArray(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidsubtractShortBufferFromArray(short[] dest, int destPos, ShortBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).static voidswapByteBuffer(ByteBuffer first, int firstPos, ByteBuffer second, int secondPos, int count) Swaps count byte elements in first buffer, starting from firstPos index, with count byte elements in second buffer, starting from secondPos index.static voidswapCharBuffer(CharBuffer first, int firstPos, CharBuffer second, int secondPos, int count) Swaps count char elements in first buffer, starting from firstPos index, with count char elements in second buffer, starting from secondPos index.static voidswapDoubleBuffer(DoubleBuffer first, int firstPos, DoubleBuffer second, int secondPos, int count) Swaps count double elements in first buffer, starting from firstPos index, with count double elements in second buffer, starting from secondPos index.static voidswapFloatBuffer(FloatBuffer first, int firstPos, FloatBuffer second, int secondPos, int count) Swaps count float elements in first buffer, starting from firstPos index, with count float elements in second buffer, starting from secondPos index.static voidswapIntBuffer(IntBuffer first, int firstPos, IntBuffer second, int secondPos, int count) Swaps count int elements in first buffer, starting from firstPos index, with count int elements in second buffer, starting from secondPos index.static voidswapLongBuffer(LongBuffer first, int firstPos, LongBuffer second, int secondPos, int count) Swaps count long elements in first buffer, starting from firstPos index, with count long elements in second buffer, starting from secondPos index.static voidswapShortBuffer(ShortBuffer first, int firstPos, ShortBuffer second, int secondPos, int count) Swaps count short elements in first buffer, starting from firstPos index, with count short elements in second buffer, starting from secondPos index.
-
Method Details
-
copyByteBuffer
public static void copyByteBuffer(ByteBuffer dest, int destPos, ByteBuffer src, int srcPos, int count) Copies count byte elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for ByteBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination ByteBuffer.destPos- starting index of element to replace.src- the source ByteBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyByteBuffer
public static void copyByteBuffer(ByteBuffer dest, int destPos, ByteBuffer src, int srcPos, int count, boolean reverseOrder) Copies count byte elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyByteBuffer(ByteBuffer, int, ByteBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination ByteBuffer.destPos- starting index of element to replace.src- the source ByteBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapByteBuffer
public static void swapByteBuffer(ByteBuffer first, int firstPos, ByteBuffer second, int secondPos, int count) Swaps count byte elements in first buffer, starting from firstPos index, with count byte elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first ByteBuffer.firstPos- starting index of element to exchange in the first ByteBuffer.second- the second ByteBuffer.secondPos- starting index of element to exchange in the second ByteBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyCharBuffer
public static void copyCharBuffer(CharBuffer dest, int destPos, CharBuffer src, int srcPos, int count) Copies count char elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for CharBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination CharBuffer.destPos- starting index of element to replace.src- the source CharBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyCharBuffer
public static void copyCharBuffer(CharBuffer dest, int destPos, CharBuffer src, int srcPos, int count, boolean reverseOrder) Copies count char elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyCharBuffer(CharBuffer, int, CharBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination CharBuffer.destPos- starting index of element to replace.src- the source CharBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapCharBuffer
public static void swapCharBuffer(CharBuffer first, int firstPos, CharBuffer second, int secondPos, int count) Swaps count char elements in first buffer, starting from firstPos index, with count char elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first CharBuffer.firstPos- starting index of element to exchange in the first CharBuffer.second- the second CharBuffer.secondPos- starting index of element to exchange in the second CharBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyShortBuffer
public static void copyShortBuffer(ShortBuffer dest, int destPos, ShortBuffer src, int srcPos, int count) Copies count short elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for ShortBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination ShortBuffer.destPos- starting index of element to replace.src- the source ShortBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyShortBuffer
public static void copyShortBuffer(ShortBuffer dest, int destPos, ShortBuffer src, int srcPos, int count, boolean reverseOrder) Copies count short elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyShortBuffer(ShortBuffer, int, ShortBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination ShortBuffer.destPos- starting index of element to replace.src- the source ShortBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapShortBuffer
public static void swapShortBuffer(ShortBuffer first, int firstPos, ShortBuffer second, int secondPos, int count) Swaps count short elements in first buffer, starting from firstPos index, with count short elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first ShortBuffer.firstPos- starting index of element to exchange in the first ShortBuffer.second- the second ShortBuffer.secondPos- starting index of element to exchange in the second ShortBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyIntBuffer
Copies count int elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for IntBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination IntBuffer.destPos- starting index of element to replace.src- the source IntBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyIntBuffer
public static void copyIntBuffer(IntBuffer dest, int destPos, IntBuffer src, int srcPos, int count, boolean reverseOrder) Copies count int elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyIntBuffer(IntBuffer, int, IntBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination IntBuffer.destPos- starting index of element to replace.src- the source IntBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapIntBuffer
public static void swapIntBuffer(IntBuffer first, int firstPos, IntBuffer second, int secondPos, int count) Swaps count int elements in first buffer, starting from firstPos index, with count int elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first IntBuffer.firstPos- starting index of element to exchange in the first IntBuffer.second- the second IntBuffer.secondPos- starting index of element to exchange in the second IntBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyLongBuffer
public static void copyLongBuffer(LongBuffer dest, int destPos, LongBuffer src, int srcPos, int count) Copies count long elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for LongBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination LongBuffer.destPos- starting index of element to replace.src- the source LongBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyLongBuffer
public static void copyLongBuffer(LongBuffer dest, int destPos, LongBuffer src, int srcPos, int count, boolean reverseOrder) Copies count long elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyLongBuffer(LongBuffer, int, LongBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination LongBuffer.destPos- starting index of element to replace.src- the source LongBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapLongBuffer
public static void swapLongBuffer(LongBuffer first, int firstPos, LongBuffer second, int secondPos, int count) Swaps count long elements in first buffer, starting from firstPos index, with count long elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first LongBuffer.firstPos- starting index of element to exchange in the first LongBuffer.second- the second LongBuffer.secondPos- starting index of element to exchange in the second LongBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyFloatBuffer
public static void copyFloatBuffer(FloatBuffer dest, int destPos, FloatBuffer src, int srcPos, int count) Copies count float elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for FloatBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination FloatBuffer.destPos- starting index of element to replace.src- the source FloatBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyFloatBuffer
public static void copyFloatBuffer(FloatBuffer dest, int destPos, FloatBuffer src, int srcPos, int count, boolean reverseOrder) Copies count float elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyFloatBuffer(FloatBuffer, int, FloatBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination FloatBuffer.destPos- starting index of element to replace.src- the source FloatBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapFloatBuffer
public static void swapFloatBuffer(FloatBuffer first, int firstPos, FloatBuffer second, int secondPos, int count) Swaps count float elements in first buffer, starting from firstPos index, with count float elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first FloatBuffer.firstPos- starting index of element to exchange in the first FloatBuffer.second- the second FloatBuffer.secondPos- starting index of element to exchange in the second FloatBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyDoubleBuffer
public static void copyDoubleBuffer(DoubleBuffer dest, int destPos, DoubleBuffer src, int srcPos, int count) Copies count double elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index. It is an analog of standard System.arraycopy method for DoubleBuffer.This method works correctly even if src == dest and the copied areas overlap, i.e. if Math.abs(destPos - srcPos) < count. More precisely, in this case the copying is performed as if the elements at positions srcPos..srcPos+count-1 in src buffer were first copied to a temporary array with count elements and then the contents of the temporary array were copied into positions destPos..destPos+count-1 in dest buffer.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination DoubleBuffer.destPos- starting index of element to replace.src- the source DoubleBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
copyDoubleBuffer
public static void copyDoubleBuffer(DoubleBuffer dest, int destPos, DoubleBuffer src, int srcPos, int count, boolean reverseOrder) Copies count double elements from src buffer, starting from srcPos index, to the dest buffer, starting from destPos index, in normal or reverse order depending on reverseOrder argument.If reverseOrder flag is false, this method copies elements in normal order: element #srcPos of src to element #destPos of dest, then element #srcPos+1 of src to element #destPos+1 of dest, then element #srcPos+2 of src to element #destPos+2 of dest, ..., then element #srcPos+count-1 of src to element #destPos+count-1 of dest. If reverseOrder flag is true, this method copies elements in reverse order: element #srcPos+count-1 of src to element #destPos+count-1 of dest, then element #srcPos+count-2 of src to element #destPos+count-2 of dest, ..., then element #srcPos of src to element #destPos of dest. Usually, copying in reverse order is slower, but it is necessary if src and dest are the same buffer or views or the same data (for example, buffers mapped to the same file), the copied areas overlap and destination position is greater than source position. If src==dest, you may use
copyDoubleBuffer(DoubleBuffer, int, DoubleBuffer, int, int)method that chooses the suitable order automatically.This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
dest- the destination DoubleBuffer.destPos- starting index of element to replace.src- the source DoubleBuffer.srcPos- starting index of element to be copied.count- the number of elements to be copied (should be >=0).reverseOrder- if true, the elements will be copied in the reverse order.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
swapDoubleBuffer
public static void swapDoubleBuffer(DoubleBuffer first, int firstPos, DoubleBuffer second, int secondPos, int count) Swaps count double elements in first buffer, starting from firstPos index, with count double elements in second buffer, starting from secondPos index.Some elements may be swapped incorrectly if the swapped areas overlap, i.e. if first==second and Math.abs(firstIndex - secondIndex) < count, or if first and second are views of the same data (for example, buffers mapped to the same file) and the corresponding areas of this data overlap.
This method does not modify limit, position and mark properties of the passed buffers.
- Parameters:
first- the first DoubleBuffer.firstPos- starting index of element to exchange in the first DoubleBuffer.second- the second DoubleBuffer.secondPos- starting index of element to exchange in the second DoubleBuffer.count- the number of elements to be exchanged (should be >=0).- Throws:
NullPointerException- if either first or second is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limits.
-
fillByteBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled ByteBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
fillCharBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled CharBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
fillShortBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled ShortBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
fillIntBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled IntBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
fillLongBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled LongBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
fillFloatBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled FloatBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
fillDoubleBuffer
Fills count elements in the dest buffer, starting from the element #destPos, by the specified value. Be careful: the second int argument in this method is the number of filled element, but not the end filled index as in java.util.Arrays.fill methods.This method does not modify limit, position and mark properties of the passed buffer.
- Parameters:
dest- the filled DoubleBuffer.destPos- starting index of element to replace.count- the number of elements to be filled (should be >=0).value- the filler.- Throws:
NullPointerException- if dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if copying would cause access of data outside buffer limit.
-
indexOfByte
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched ByteBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfByte
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfByte(ByteBuffer, int, int, byte)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
indexOfChar
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched CharBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfChar
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfChar(CharBuffer, int, int, char)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
indexOfShort
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched ShortBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfShort
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfShort(ShortBuffer, int, int, short)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
indexOfInt
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched IntBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfInt
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfInt(IntBuffer, int, int, int)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
indexOfLong
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched LongBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfLong
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfLong(LongBuffer, int, int, long)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
indexOfFloat
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched FloatBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfFloat
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfFloat(FloatBuffer, int, int, float)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
indexOfDouble
Returns the minimal index k, so that lowIndex<=k<min(highIndex,buffer.limit()) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if lowIndex>=buffer.limit() or lowIndex>=highIndex, this method returns -1, and if lowIndex<0, the result is the same as if lowIndex==0.
- Parameters:
buffer- the searched DoubleBuffer.lowIndex- the low index for search (inclusive).highIndex- the high index for search (exclusive); pass buffer.limit() to search all remaining elements.value- the value to be found.- Returns:
- the index of the first occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
lastIndexOfDouble
Returns the maximal index k, so that highIndex>k>=max(lowIndex,0) and buffer.get(k)==value, or -1 if there is no such buffer element.In particular, if highIndex<=0 or highIndex<=lowIndex, this method returns -1, and if highIndex>=buffer.limit(), the result is the same as if highIndex==buffer.limit().
Note that lowIndex and highIndex arguments have the same sense as in
indexOfDouble(DoubleBuffer, int, int, double)method: they describes the search index range lowIndex<=k<highIndex.- Parameters:
buffer- the searched Java array.lowIndex- the low index in the array for search (inclusive); pass 0 to search all remaining elements.highIndex- the high index in the array for search (exclusive).value- the value to be found.- Returns:
- the index of the last occurrence of this value in range lowIndex..highIndex-1, or -1 if this value does not occur or if max(lowIndex,0)>=min(highIndex,buffer.limit()).
- Throws:
NullPointerException- if buffer is null.- See Also:
-
minByteArrayAndBuffer
public static void minByteArrayAndBuffer(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos. The byte elements are considered to be unsigned: min(a,b)=(a&0xFF)<(b&0xFF)?a:b.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ByteBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxByteArrayAndBuffer
public static void maxByteArrayAndBuffer(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos. The byte elements are considered to be unsigned: min(a,b)=(a&0xFF)<(b&0xFF)?a:b.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ByteBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
minShortArrayAndBuffer
public static void minShortArrayAndBuffer(short[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos. The short elements are considered to be unsigned: min(a,b)=(a&0xFFFF)<(b&0xFFFF)?a:b.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ShortBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxShortArrayAndBuffer
public static void maxShortArrayAndBuffer(short[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos. The short elements are considered to be unsigned: min(a,b)=(a&0xFFFF)<(b&0xFFFF)?a:b.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ShortBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
minCharArrayAndBuffer
public static void minCharArrayAndBuffer(char[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source CharBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxCharArrayAndBuffer
public static void maxCharArrayAndBuffer(char[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source CharBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
minIntArrayAndBuffer
public static void minIntArrayAndBuffer(int[] dest, int destPos, IntBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source IntBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxIntArrayAndBuffer
public static void maxIntArrayAndBuffer(int[] dest, int destPos, IntBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source IntBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
minLongArrayAndBuffer
public static void minLongArrayAndBuffer(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source LongBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxLongArrayAndBuffer
public static void maxLongArrayAndBuffer(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source LongBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
minFloatArrayAndBuffer
public static void minFloatArrayAndBuffer(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source FloatBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxFloatArrayAndBuffer
public static void maxFloatArrayAndBuffer(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source FloatBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
minDoubleArrayAndBuffer
public static void minDoubleArrayAndBuffer(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source DoubleBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
maxDoubleArrayAndBuffer
public static void maxDoubleArrayAndBuffer(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the minimum of them and corresponding count elements in src buffer, starting from the element #srcPos.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source DoubleBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addByteBufferToArray
public static void addByteBufferToArray(int[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFF). The byte elements are considered to be unsigned.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ByteBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addByteBufferToArray
public static void addByteBufferToArray(double[] dest, int destPos, ByteBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFF)*mult. The byte elements are considered to be unsigned.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ByteBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addCharBufferToArray
public static void addCharBufferToArray(int[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source CharBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addCharBufferToArray
public static void addCharBufferToArray(double[] dest, int destPos, CharBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source CharBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addShortBufferToArray
public static void addShortBufferToArray(int[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFFFF). The short elements are considered to be unsigned.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ShortBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addShortBufferToArray
public static void addShortBufferToArray(double[] dest, int destPos, ShortBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)&0xFFFF)*mult. The short elements are considered to be unsigned.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ShortBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addIntBufferToArray
public static void addIntBufferToArray(int[] dest, int destPos, IntBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source IntBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addIntBufferToArray
public static void addIntBufferToArray(double[] dest, int destPos, IntBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source IntBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addLongBufferToArray
public static void addLongBufferToArray(int[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source LongBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addLongBufferToArray
public static void addLongBufferToArray(double[] dest, int destPos, LongBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source LongBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addFloatBufferToArray
public static void addFloatBufferToArray(int[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source FloatBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addFloatBufferToArray
public static void addFloatBufferToArray(double[] dest, int destPos, FloatBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source FloatBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addDoubleBufferToArray
public static void addDoubleBufferToArray(int[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i)).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source DoubleBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
addDoubleBufferToArray
public static void addDoubleBufferToArray(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count, double mult) Replaces count elements in dest array, starting from the element #destPos, with the sum of them and corresponding count elements in src buffer, multiplied by mult argument, starting from the element #srcPos: dest[destPos+i]+=(src.get(srcPos+i))*mult.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source DoubleBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).mult- the elements from src array are multiplied by this value before adding.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limit.
-
subtractByteBufferFromArray
public static void subtractByteBufferFromArray(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i). If truncateOverflows argument is true, the difference is truncated to 0..0xFF range before assigning to dest elements. The byte elements are considered to be unsigned.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ByteBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).truncateOverflows- whether the results should be truncated to 0..0xFF range.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
subtractCharBufferFromArray
public static void subtractCharBufferFromArray(char[] dest, int destPos, CharBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i). If truncateOverflows argument is true, the difference is truncated to 0..0xFFFF range before assigning to dest elements.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source CharBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).truncateOverflows- whether the results should be truncated to 0..0xFFFF range.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
subtractShortBufferFromArray
public static void subtractShortBufferFromArray(short[] dest, int destPos, ShortBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i). If truncateOverflows argument is true, the difference is truncated to 0..0xFFFF range before assigning to dest elements. The short elements are considered to be unsigned.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ShortBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).truncateOverflows- whether the results should be truncated to 0..0xFFFF range.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
subtractIntBufferFromArray
public static void subtractIntBufferFromArray(int[] dest, int destPos, IntBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i). If truncateOverflows argument is true, the difference is truncated to Integer.MIN_VALUE..Integer.MAX_VALUE range before assigning to dest elements.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source IntBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).truncateOverflows- whether the results should be truncated to Integer.MIN_VALUE..Integer.MAX_VALUE range.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
subtractLongBufferFromArray
public static void subtractLongBufferFromArray(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source LongBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
subtractFloatBufferFromArray
public static void subtractFloatBufferFromArray(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source FloatBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
subtractDoubleBufferFromArray
public static void subtractDoubleBufferFromArray(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=dest[destPos+i]-src.get(srcPos+i).- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source DoubleBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfByteArrayAndBuffer
public static void absDiffOfByteArrayAndBuffer(byte[] dest, int destPos, ByteBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|. (The byte elements are considered to be unsigned.)- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ByteBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfCharArrayAndBuffer
public static void absDiffOfCharArrayAndBuffer(char[] dest, int destPos, CharBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source CharBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfShortArrayAndBuffer
public static void absDiffOfShortArrayAndBuffer(short[] dest, int destPos, ShortBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|. (The short elements are considered to be unsigned.)- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source ShortBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfLongArrayAndBuffer
public static void absDiffOfLongArrayAndBuffer(long[] dest, int destPos, LongBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source LongBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfFloatArrayAndBuffer
public static void absDiffOfFloatArrayAndBuffer(float[] dest, int destPos, FloatBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source FloatBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfDoubleArrayAndBuffer
public static void absDiffOfDoubleArrayAndBuffer(double[] dest, int destPos, DoubleBuffer src, int srcPos, int count) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src.get(srcPos+i)|.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source DoubleBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-
absDiffOfIntArrayAndBuffer
public static void absDiffOfIntArrayAndBuffer(int[] dest, int destPos, IntBuffer src, int srcPos, int count, boolean truncateOverflows) Replaces count elements in dest array, starting from the element #destPos, with the absolute value of the difference of them and corresponding count elements in src buffer, starting from the element #srcPos: dest[destPos+i]=|dest[destPos+i]-src[srcPos+i]|. If truncateOverflows argument is true, the difference is truncated to 0..Integer.MAX_VALUE range before assigning to dest elements.- Parameters:
dest- the destination array.destPos- position of the first replaced element in the destination array.src- the source IntBuffer.srcPos- position of the first read element in the source buffer.count- the number of elements to be replaced (should be >=0).truncateOverflows- whether the results should be truncated to Integer.MIN_VALUE..Integer.MAX_VALUE range.- Throws:
NullPointerException- if either src or dest is null.IllegalArgumentException- if count is negative.IndexOutOfBoundsException- if accessing elements would cause access of data outside array bounds or buffer limits.
-