[omniORB] Octet type
Victor Chen
victorcd@163.net
Wed, 11 Apr 2001 08:34:08 +0800
SSB0aGluayB0aGUgYmVzdCBtZXRob2QgIGlzIHVzaW5nIGl0J3MgY29uc3RydWN0ZXI6DQppbiBJ
REwgOiB0eXBlZGVmIHNlcXVlbmNlPG9jdGV0PiBiaW5hcnlkYXRhDQoNCkNPUkJBOjpMb25nIE15
QWRtaW5faW1wbDo6R2V0RmlsZShjb25zdCBteXNlY2luZm8mIFNlY0luZm8sQ09SQkE6Okxvbmcg
dHlwZSwgYmluYXJ5ZGF0YV9vdXQgRGF0YSkNCnsNCiAgICBpbnQgaT0tMTsNCiAgICBpbnQgZmQ7
DQogICAgc3RydWN0IHN0YXQgZnN0Ow0KICAgIENPUkJBOjpPY3RldCAqT3V0RGF0YTsNCiAgICBj
aGFyIERlc3RGaWxlTmFtZVsyNTVdOw0KICAgIGJpbmFyeWRhdGFfdmFyIFRlbXBEYXRhOw0KICAg
IGlmIChJc0FkbWluKFNlY0luZm8pKQ0KICAgIHsNCiAgICAgICAgaWYgKHR5cGU9PTApDQogICAg
ICAgICAgICBzdHJjcHkoRGVzdEZpbGVOYW1lLCJteWZpbGVfMCIpOw0KICAgICAgICBlbHNlIHN0
cmNweShEZXN0RmlsZU5hbWUsIm15ZmlsZV8xMCIpOw0KICAgICBpZiAoKGZkID0gb3BlbihEZXN0
RmlsZU5hbWUsT19SRE9OTFksMDQwMCkpPDApew0KICAgICAgIHByaW50ZigiQ2Fubm90IG9wZW4g
dGhlIGZpbGUgJXMgLHVzZXIgY2FuIG5vdCBhdXRvdXBncmFkZVxuIixEZXN0RmlsZU5hbWUpOw0K
ICAgICB9DQogICAgIGVsc2UNCiAgICAgew0KICAgICAgICAgaWYgKGZzdGF0KGZkLCZmc3QpPT0w
KQ0KICAgICAgICAgew0KICAgICAgICAgICAgIGRlYnVnKDEpICgiZmlsZSAlcyBTaXplID0gJWRc
biIsRGVzdEZpbGVOYW1lLGZzdC5zdF9zaXplKTsNCiAg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