I did this and removed that code because I felt we will not get the exact size and we may need to do a byte copy for getting the exact length of the byte[].  If not the byte[] that is used in recreation of the array would not work correctly because we have moved the headers to the last.  If not TrustedByteArrayOutputSTream would have been fine.  So let me calculate the exact size considering nulls > 255.