public ByteArraySegment subSegment ( int offset , int length , boolean readOnly ) { Exceptions . checkArrayRange ( offset , length , this . length , "offset" , "length" ) ; return new ByteArraySegment ( this . array , this . startOffset + offset , length , readOnly || this . readOnly ) ; }
Returns a new ByteArraySegment that is a sub - segment of this ByteArraySegment . The new ByteArraySegment wraps the same underlying byte array that this ByteArraySegment does .