Solace API (C#) on Document Too Large

Is it possible to make sure your String / byte array / payload isn’t bigger than 30MB or whatever before attempting to publish it?