This method can be called to obtain a buffer size before a GetBuffer method call.
See the GetBuffer method for examples.