Itβs good practice to extend the general code to a convenient method so that many callers can name this convenient method. This is independent of the type of return. If callers will need to be manipulated byte[] , then this can be convenient and eliminate redundant code.
By the way, regarding the code you posted, is this real code or just an example? If this is real code:
- It will not compile because it does not return
byte[] . - If you should have called
return doc; as the last line, why is GenerateDoc() inside GetDoc() ? GetDoc() really does not provide any real benefits.
Kevin Le - Khnle
source share