public void copyFrom ( ByteArraySegment source , int targetOffset , int length ) { Preconditions . checkState ( ! this . readOnly , "Cannot modify a read-only ByteArraySegment." ) ; Exceptions . checkArrayRange ( targetOffset , length , this . length , "index" , "values.length" ) ; Preconditions . checkElementIndex ( length , source . getLength ( ) + 1 , "length" ) ; System . arraycopy ( source . array , source . startOffset , this . array , targetOffset + this . startOffset , length ) ; }
Copies a specified number of bytes from the given ByteArraySegment into this ByteArraySegment .