occasionally, we need to konw the exact size of each Ice object. so we have to do serialization manually.
first...compile .ice file with --stream.
ICE will generate a helper function for every entity class.
for checking size, write it to outputstream first:
Ice.Communicator comm = Ice.Util.initialize();
Ice.OutputStream os = Ice.Util.createOutputStream(comm);
Txx xx = new Txx() //this Txx type is derived from Ice.Object
TxxHelper.write(os, xx);
os.writePendingObjects(); //make sure all bytes run into stream buffer.
byte[] data = os.finished();
os.destroy();
now check the size of data and you will know how many bytes your object does consume.
for reading an object from inputstream. do it in opposite way:
Ice.InputStream ins = Ice.Util.createInputStream(comm, data);
TxxHelper helper = new TxxHelper(ins);
helper.read();
ins.readPendingObjects();
if no exception, you may play the object with helper.value .
According to the manual, --stream is available for c++/java/c# only.
分享到:
相关推荐
If you want to know how many printing columns a Unicode string will occupy when you print it out using a fixed-width font (imagine you are writing something like the Unix ls program that formats its ...
ful system that describes how views and their content relate to each other and to the superviews they occupy. In contrast to older design approaches, this technology offers incredible control over ...
LARGE_OBJECT_SIZE_COUNTER_009_HELP=This counter displays the current size of the Large Object Heap in bytes. Objects greater than 20 KBytes are treated as large objects by the Garbage Collector and ...
Have you a tools software for manage a lot of your own wallpapers? Waller Easy is it. It provides you 2 ways to active wallpaper. One was called system start mode, with this mode application will be...
files occupy about 0.5Mb of hard disk space. A display resolution of 640x480 (standard VGA) or better is recommended. Mask for Windows - PRWin98 will run on any 80286, 80386, 80486 (SX, DX, DX2), or ...
If you don't know how to determine wheather encounted the end of input: s is a string and n is an integer C++ while(cin>>s>>n) { ... } c while(scanf("%s%d",s,&n)==2) //to see if the scanf read...
An int type variable always occupy 4 bytes consecutively, so is an array of 4 char type elements. Write a function to convert an unsigned int type variable into an array of 4 char type elements.
- exist: 存在,如:Does life exist on other planets? - appear: 出现,如:Suddenly, a rabbit appeared in front of us. - survive: 幸存,如:She survived the earthquake but lost her family. - live: ...
13. "A proper part-time job does not occupy students' too much time. In fact, it is unhealthy for them always to sit in the classroom studying all the time." 这句话支持适度兼职工作对学生的好处,可以...
2. **合理安排工作与休息**:“A proper part-time job does not occupy students too much time. In fact, it is unhealthy for them to spend all time on their study. As an old saying goes: All work and no ...
> A proper part-time job does not occupy students too much time. In fact, it is unhealthy for them to spend all the time on their study. As an old saying goes: All work and no play makes Jack a dull ...
Use Object Oriented Design and Modeling appropriately for extensibility. Please supply all the code for your solution in the file Answer.cs in the SampleProgram project. Please supply all the tests ...
- "A proper part-time job does not occupy students' too much time. In fact, it is unhealthy for them to spend all time on their study. As an old saying goes: All work and no play makes Jack a dull ...
10. The experiences you have and the people you meet will provide you with many lifelong memories that you’ll cherish forever. Tele-Education 远程教育 1. (优点): Improve the flexibility of learning ...
- 句式:A proper part-time job does not occupy students too much time. In fact, it is unhealthy for them to spend all time on their study. As an old saying goes: All work and no play makes Jack a ...
The study also examined if there was any relationship between an IT professional's understanding of big data and the position they occupy professionally. Table of Contents Acknowledgments ...
### 句型12: A proper part-time job does not occupy students' too much time. In fact, it is unhealthy for them to spend all their time on their study. 最后,这个句型通过“in fact”转折,指出兼职工作...
例如,"occupy sb. /oneself with sth. /(in) doing sth." 表示“使某人忙于某事”,而 "sb. be occupied with sth. /(in) doing sth." 则表示“某人正忙于某事”。同时,课程还扩展介绍了其他表达“忙于做某事”的...
Introducing Data Science teaches you how to accomplish the fundamental tasks that occupy data scientists. Using the Python language and common Python libraries, you’ll experience firsthand the ...
还可以表示“忙于做某事”,如:他退休后如何打发时间呢(How does he occupy himself now he's retired?)。 - **integrate**:意为“构成整体”,例如:这些建筑与周围景观完美融合(The buildings are well ...