when reading a document, instead of returning a slice of buffer, it should return a copy of buffered document content