/* Returns the number of byte removed or 0 in case of failure  */
size_t xmlBufShrink(xmlBufPtr buf, size_t len)
/* Returns the number of byte removed or 0 in case of failure  */
size_t xmlBufShrink(xmlBufPtr buf, size_t len)
{
        buf->content += len;
	buf->size -= len;
	if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
	    size_t start_buf = buf->content - buf->contentIO;
	    if (start_buf >= buf->size) {
		memmove(buf->contentIO, &buf->content[0], buf->use);
		buf->content = buf->contentIO;
		buf->content[buf->use] = 0;
		buf->size += start_buf;
	    }
	}
    } else {
	memmove(buf->content, &buf->content[len], buf->use);
	buf->content[buf->use] = 0;
    }
    UPDATE_COMPAT(buf)
    return(len);
}