private static void CheckWritableBounds(IByteBuffer dst, int length) { if ((uint)length > (uint)dst.WritableBytes) { ThrowHelper.ThrowIndexOutOfRangeException_WritableBytes(length, dst); } }
public virtual IByteBuffer ReadBytes(IByteBuffer dst, int length) { if (length > dst.WritableBytes) { ThrowHelper.ThrowIndexOutOfRangeException_WritableBytes(length, dst); } this.ReadBytes(dst, dst.WriterIndex, length); dst.SetWriterIndex(dst.WriterIndex + length); return(this); }