// Note: very simple, not efficient implementation, sorry.
int count = 0;
while (spos < slen && count < buffer.length - to.length) {
// Note: very simple, not efficient implementation, sorry.
int count = 0;
while (spos < slen && count < buffer.length - to.length) {