Encodes the content to bytes before insertion.