| | |
Bitwise Encoding
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
> 0-5 : 4 bits
I wonder how you came up with 4. ;-)
@llemes4011
Coming up with your own serialization mechanism is hard; continue if you are doing this for fun but do remember that there are many other good binary serialization formats out there which can lessen your work and reduce the agony. A comparison of various serialization libraries can be found here.
I wonder how you came up with 4. ;-)
@llemes4011
Coming up with your own serialization mechanism is hard; continue if you are doing this for fun but do remember that there are many other good binary serialization formats out there which can lessen your work and reduce the agony. A comparison of various serialization libraries can be found here.
Last edited by ~s.o.s~; Jul 11th, 2009 at 12:04 pm.
I don't accept change; I don't deserve to live.
> closer to around 40,000
40,000 is nothing, unless you have some specifications which you would need to meet and you have *confirmed* that doing things your way is much faster than the other simpler approaches.
IMO just go with the normal way of doing things i.e. writing data as comma separated values. If you are feeling adventurous, rather screw around with an embeddable database than get involved with all the bit-fiddling. Optimize when needed and that too after profiling; premature optimization is the root of all evil.
40,000 is nothing, unless you have some specifications which you would need to meet and you have *confirmed* that doing things your way is much faster than the other simpler approaches.
IMO just go with the normal way of doing things i.e. writing data as comma separated values. If you are feeling adventurous, rather screw around with an embeddable database than get involved with all the bit-fiddling. Optimize when needed and that too after profiling; premature optimization is the root of all evil.
I don't accept change; I don't deserve to live.
field1(int) range = 0 to 5 {3}
field2(float) range = 0.00 to 30.00 (need 2 sig-figs) {5+7=12}
field3(float) range = 0.00 to 30.00 (need 2 sig-figs) {5+7=12}
field4(int) range = 0 to 100 {3}
So 30 bits total. 32-bit integer so 2 spare bits. What fields should those two bits be given to for future expansion?
so 32/192 compaction ratio.
field2(float) range = 0.00 to 30.00 (need 2 sig-figs) {5+7=12}
field3(float) range = 0.00 to 30.00 (need 2 sig-figs) {5+7=12}
field4(int) range = 0 to 100 {3}
So 30 bits total. 32-bit integer so 2 spare bits. What fields should those two bits be given to for future expansion?
so 32/192 compaction ratio.
![]() |
Similar Threads
- Internet Explorer SP2 Encoding Error (Web Browsers)
- Explorer Encoding (Web Browsers)
- Encoding/Decoding (C)
- Bitwise AND (C++)
- Bitwise operators (C)
Other Threads in the Java Forum
- Previous Thread: repaint won't call paintComponent(Graphics )
- Next Thread: illegal start of expression
| Thread Tools | Search this Thread |
android api applet application applications array arrays automation balls bank binary bluetooth business chat class classes clear client code codesnippet collections component database db defaultmethod development dice dragging draw ebook eclipse error event exception formatingtextintooltipjava fractal game givemetehcodez graphics gui hql html ide image infinite input integer invokingapacheantprogrammatically j2me java javaprojects jni jpanel julia linux list loop looping map method methods mobile mysql netbeans newbie numbers openjavafx oracle parameter php print problem program programming project recursion repositories scanner screen scrollbar server set size sms sort sorting sql sqlserver state storm string sun superclass swing swt text-file threads time tree windows






