func WrapByteSliceInplace(s []byte, width int) []byte {
	if width < 1 {
		return s
	}
	var l, lines int
	l = len(s)
	if l%width == 0 {
		lines = l/width - 1
	} else {
		lines = int(l / width)
	}
	var end int
	j := 0
	for i := 0; i <= lines; i++ {
		end = (i+1)*width + j
		if end >= l {
			break
		}
		if i < lines {
			s = append(s[:end], append([]byte("\n"), s[end:]...)...)
			l = len(s)
			if l%width == 0 {
				lines = l/width - 1
			} else {
				lines = int(l / width)
			}
			j++
		}
	}
	return s
}
WrapByteSliceInplace wraps byte slice in place.
Sadly, it's too slow. Never use this!
package byteutil
import (
	"bytes"
	"unsafe"
	"github.com/shenwei356/bpool"
)
func ReverseByteSlice(s []byte) []byte {
	l := len(s)
	t := make([]byte, l)
	for i := 0; i < l; i++ {
		t[i] = s[i]
	}
	for i, j := 0, l-1; i < j; i, j = i+1, j-1 {
		t[i], t[j] = t[j], t[i]
	}
	return t
}
func ReverseByteSliceInplace(s []byte) {
	for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
		s[i], s[j] = s[j], s[i]
	}
}
func WrapByteSlice(s []byte, width int) []byte {
	if width < 1 {
		return s
	}
	l := len(s)
	if l == 0 {
		return s
	}
	var lines int
	if l%width == 0 {
		lines = l/width - 1
	} else {
		lines = int(l / width)
	}
	buffer := bytes.NewBuffer(make([]byte, 0, l+lines))
	var start, end int
	for i := 0; i <= lines; i++ {
		start = i * width
		end = (i + 1) * width
		if end > l {
			end = l
		}
		buffer.Write(s[start:end])
		if i < lines {
			buffer.WriteString("\n")
		}
	}
	return buffer.Bytes()
}
type BufferedByteSliceWrapper struct {
	pool *bpool.SizedBufferPool
}
func NewBufferedByteSliceWrapper(size, alloc int) *BufferedByteSliceWrapper {
	if size < 1 {
		panic("buffer number should be > 0")
	}
	if alloc < 1 {
		panic("buffer size should be > 0")
	}
	return &BufferedByteSliceWrapper{bpool.NewSizedBufferPool(size, alloc)}
}
func NewBufferedByteSliceWrapper2(size int, length, width int) *BufferedByteSliceWrapper {
	if size < 1 {
		size = 1
	}
	if length < 1 {
		length = 1
	}
	if width <= 0 {
		return NewBufferedByteSliceWrapper(size, length)
	}
	var lines int
	if length%width == 0 {
		lines = length/width - 1
	} else {
		lines = int(length / width)
	}
	return &BufferedByteSliceWrapper{bpool.NewSizedBufferPool(size, length+lines)}
}
func (w *BufferedByteSliceWrapper) Recycle(b *bytes.Buffer) {
	w.pool.Put(b)
}
func (w *BufferedByteSliceWrapper) Wrap(s []byte, width int) ([]byte, *bytes.Buffer) {
	if width < 1 {
		return s, nil
	}
	l := len(s)
	if l == 0 {
		return s, nil
	}
	var lines int
	if l%width == 0 {
		lines = l/width - 1
	} else {
		lines = int(l / width)
	}
	buffer := w.pool.Get()
	var start, end int
	for i := 0; i <= lines; i++ {
		start = i * width
		end = (i + 1) * width
		if end > l {
			end = l
		}
		buffer.Write(s[start:end])
		if i < lines {
			buffer.WriteString("\n")
		}
	}
	return buffer.Bytes(), buffer
}