public byte getStreamFormatVersionForReply() {
// NOTE: The request service contexts may indicate the max.
ServiceContexts svc = getRequestServiceContexts();
MaxStreamFormatVersionServiceContext msfvsc
= (MaxStreamFormatVersionServiceContext)svc.get(
MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID);
if (msfvsc != null) {
byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion();
byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion();
return (byte)Math.min(localMaxVersion, remoteMaxVersion);
} else {
// Defaults to 1 for GIOP 1.2 or less, 2 for
// GIOP 1.3 or higher.