public final LogBuffer duplicate ( final int pos , final int len ) { if ( pos + len > limit ) throw new IllegalArgumentException ( "limit excceed: " + ( pos + len ) ) ; // XXX: Do momery copy avoid buffer modified. final int off = origin + pos ; byte [ ] buf = Arrays . copyOfRange ( buffer , off , off + len ) ; return new LogBuffer ( buf , 0 , len ) ; }
Return n bytes in this buffer .