public static FastStr unsafeOf ( char [ ] buf , int start , int end ) { E . NPE ( buf ) ; E . illegalArgumentIf ( start < 0 || end > buf . length ) ; if ( end < start ) return EMPTY_STR ; return new FastStr ( buf , start , end ) ; }
Construct a FastStr instance from char array from the start position finished at end position without copying the array . This method might use the array directly instead of copying elements from the array . Thus it is extremely important that the array buf passed in will NOT be updated outside the FastStr instance .