<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">ah, yes.<br>
probably that is the one-off mistake int ;)<br>
<br>
Peter<br>
<br>
On 01.07.2015 19:53, John Zhao wrote:<br>
</div>
<blockquote
cite="mid:CA+EBg9S6D2mnFATGzGJT8dWNbVj1WeTPn7AckQUgEd9ppvae3Q@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Peter,
<div><br>
</div>
<div>No. The header size is 20 now.</div>
<div>I think we can just put the extra int to header array, make
it header[21].</div>
<div><br>
</div>
<div>Now, there is a hole from 96-100 bytes on the header.</div>
<div>:)</div>
<div>not big deal.</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div class="gmail_signature"><b>Best Regards,</b>
<div><b>ZhiQiang ZHAO</b></div>
</div>
</div>
<br>
<div class="gmail_quote">On Tue, Jun 30, 2015 at 11:06 PM, Peter
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:graphhopper@gmx.de" target="_blank">graphhopper@gmx.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>You mean adding it as a separate header variable?<br>
<br>
Regards,<br>
Peter
<div>
<div class="h5"><br>
<br>
On 01.07.2015 08:02, John Zhao wrote:<br>
</div>
</div>
</div>
<div>
<div class="h5">
<blockquote type="cite">
<div dir="ltr">Hi Peter,
<div><br>
</div>
<div>Thanks for your reply.</div>
<div>I think we can add it to headers[21].</div>
<div>But nvm, not big deal.</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div><b>Best Regards,</b>
<div><b>ZhiQiang ZHAO</b></div>
</div>
</div>
<br>
<div class="gmail_quote">On Tue, Jun 30, 2015 at
10:55 PM, Peter <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:graphhopper@gmx.de"
target="_blank">graphhopper@gmx.de</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Hi John,<br>
<br>
yes, this is a bit waste of space :)<br>
<br>
But the empty space is to avoid thinking
about header size in the consuming class
but mainly to avoid breaking the file
format when we insert new data there.<br>
<br>
Regards,<br>
Peter
<div>
<div><br>
<br>
On 01.07.2015 02:04, John Zhao wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>
<div><span
style="color:rgb(128,128,128);font-family:Menlo;font-size:12pt;font-style:italic">/**<br>
</span><span
style="color:rgb(128,128,128);font-family:Menlo;font-size:12pt;font-style:italic"> * Writes some internal data into the beginning of the specified file.<br>
</span><span
style="color:rgb(128,128,128);font-family:Menlo;font-size:12pt;font-style:italic"> */<br>
</span><span
style="color:rgb(0,0,128);font-family:Menlo;font-size:12pt;font-weight:bold">protected void </span><font
face="Menlo"><span
style="font-size:12pt">writeHeader( RandomAccessFile file, </span></font><span
style="color:rgb(0,0,128);font-family:Menlo;font-size:12pt;font-weight:bold">long </span><font
face="Menlo"><span
style="font-size:12pt">length, </span></font><span
style="color:rgb(0,0,128);font-family:Menlo;font-size:12pt;font-weight:bold">int </span><font
face="Menlo"><span
style="font-size:12pt">segmentSize ) </span></font><span
style="color:rgb(0,0,128);font-family:Menlo;font-size:12pt;font-weight:bold">throws </span><font
face="Menlo"><span
style="font-size:12pt">IOException</span></font><br>
<font face="Menlo"><span
style="font-size:12pt">{</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">
file.seek(</span></font><span
style="color:rgb(0,0,255);font-family:Menlo;font-size:12pt">0</span><font
face="Menlo"><span
style="font-size:12pt">);</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">
file.writeUTF(</span></font><span
style="color:rgb(0,128,0);font-family:Menlo;font-size:12pt;font-weight:bold">"GH</span><font
color="#008000" face="Menlo"><span
style="font-size:16px"><b>”</b></span></font><font
face="Menlo"><span
style="font-size:12pt">); //
4 bytes</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">
file.writeLong(length); // 8
bytes</span></font><br>
<font face="Menlo"><span
style="font-size:12pt">
file.writeInt(segmentSize);
// 4 bytes</span></font><br>
<font face="Menlo"><span
style="font-size:12pt"> </span></font>
<span
style="color:rgb(0,0,128);font-family:Menlo;font-size:12pt;font-weight:bold">for </span><font
face="Menlo"><span
style="font-size:12pt">(</span></font><span
style="color:rgb(0,0,128);font-family:Menlo;font-size:12pt;font-weight:bold">int </span><font
face="Menlo"><span
style="font-size:12pt">i = </span></font><span
style="color:rgb(0,0,255);font-family:Menlo;font-size:12pt">0</span><font
face="Menlo"><span
style="font-size:12pt">; i < </span></font><span
style="color:rgb(102,14,122);font-family:Menlo;font-size:12pt;font-weight:bold">header</span><font
face="Menlo"><span
style="font-size:12pt">.</span></font><span
style="color:rgb(102,14,122);font-family:Menlo;font-size:12pt;font-weight:bold">length</span><font
face="Menlo"><span
style="font-size:12pt">; i++)</span></font><br>
<font face="Menlo"><span
style="font-size:12pt"> {</span></font><br>
<font face="Menlo"><span
style="font-size:12pt">
file.writeInt(</span></font><span
style="color:rgb(102,14,122);font-family:Menlo;font-size:12pt;font-weight:bold">header</span><font
face="Menlo"><span
style="font-size:12pt">[i]);</span></font><br>
<font face="Menlo"><span
style="font-size:12pt"> }</span></font>
</div>
<div><font face="Menlo"><span
style="font-size:12pt">}</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt"><br>
</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">it's
totally 100 bytes.</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">We
only use 96 bytes of them.</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt"><br>
</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">It's
not a problem.</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">Just
curious.</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt"><br>
</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt">It's
better to use them all, to
reduce any further question.
:)</span></font></div>
<div><font face="Menlo"><span
style="font-size:12pt"><br>
</span></font></div>
<div>
<div><b>Best Regards,</b>
<div><b>ZhiQiang ZHAO</b></div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</div>
</div>
</div>
<br>
_______________________________________________<br>
GraphHopper mailing list<br>
<a moz-do-not-send="true"
href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a><br>
<a moz-do-not-send="true"
href="https://lists.openstreetmap.org/listinfo/graphhopper"
rel="noreferrer" target="_blank">https://lists.openstreetmap.org/listinfo/graphhopper</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
</blockquote>
<br>
</body>
</html>