Interface CharArrayAccessible


  • public interface CharArrayAccessible
    Marker interface for telling that the underlying char array is directly accessible This interface is missing from the JVM although String, StringBuffer and StringBuilder all have this method.
    Since:
    2.3
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void getChars​(int srcBegin, int srcEnd, char[] dst, int dstBegin)
      Characters are copied from this sequence into the destination character array dst.
    • Method Detail

      • getChars

        void getChars​(int srcBegin,
                      int srcEnd,
                      char[] dst,
                      int dstBegin)
        Characters are copied from this sequence into the destination character array dst. The first character to be copied is at index srcBegin; the last character to be copied is at index srcEnd-1. The total number of characters to be copied is srcEnd-srcBegin. The characters are copied into the subarray of dst starting at index dstBegin and ending at index:

         dstbegin + (srcEnd-srcBegin) - 1
         
        Parameters:
        srcBegin - start copying at this offset.
        srcEnd - stop copying at this offset.
        dst - the array to copy the data into.
        dstBegin - offset into dst.
        Throws:
        java.lang.NullPointerException - if dst is null.
        java.lang.IndexOutOfBoundsException - if any of the following is true:
        • srcBegin is negative
        • dstBegin is negative
        • the srcBegin argument is greater than the srcEnd argument.
        • srcEnd is greater than this.length().
        • dstBegin+srcEnd-srcBegin is greater than dst.length