Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>1) Does this look sane? </p> <p>It looks fairly sane. However, if you are going to invent your own format rather than just using <a href="http://java.sun.com/developer/technicalArticles/Programming/serialization/" rel="nofollow noreferrer">Java serialization</a> then you should have a good reason. Do you have any good reasons (they do exist in some cases)? One of the standard reasons for using XStream is to make the result human readable, which a binary format immediately loses. Do you have a good reason for a binary format rather than a human readable one? See <a href="https://stackoverflow.com/questions/568671">this question</a> for why human readable is good (and bad).</p> <p>Wouldn't it be easier just to put everything in a signed jar. There are already <a href="http://java.sun.com/docs/books/tutorial/deployment/jar/apiindex.html" rel="nofollow noreferrer">standard Java libraries</a> and <a href="http://java.sun.com/docs/books/tutorial/deployment/jar/" rel="nofollow noreferrer">tools</a> to do this, and you get compression and verification provided.</p> <p>2) What would you use for a delimiter and how determine it? </p> <p>Rather than a delimiter I'd explicitly store the length of each block before the block. It's just as easy, and prevents you having to escape the delimiter if it comes up on its own. </p> <p>3) The right way to calculate MD5 in this case? </p> <p>There is <a href="http://www.java2s.com/Tutorial/Java/0490__Security/MD5MessageDigestyourmessage.htm" rel="nofollow noreferrer">example code here</a> which looks sensible.</p> <p>4) What would you suggest to read on the subject? </p> <p>On the subject of serialization? I'd read about the Java serialization, <a href="http://www.json.org/" rel="nofollow noreferrer">JSON</a>, and XStream serialization so I understood the pros and cons of each, especially the benefits of human readable files. I'd also look at a classic file format, for example from Microsoft, to understand possible design decisions from back in the days that every byte mattered, and how these have been extended. For example: <a href="http://ccrma.stanford.edu/courses/422/projects/WaveFormat/" rel="nofollow noreferrer">The WAV file format</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload