Skip to content

Commit 1722ef5

Browse files
committed
going to store asap hop list with chunks and transmit with assimilate pdu.
1 parent 2db07ca commit 1722ef5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/net/sharksystem/asap/engine/ASAPInternalChunkFS.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package net.sharksystem.asap.engine;
22

33
import net.sharksystem.asap.ASAPChannel;
4+
import net.sharksystem.asap.ASAPException;
45
import net.sharksystem.asap.ASAPHop;
6+
import net.sharksystem.asap.utils.ASAPSerialization;
57
import net.sharksystem.asap.utils.Helper;
68

79
import java.io.*;
@@ -300,10 +302,13 @@ private boolean readMetaData(File metaFile) throws IOException {
300302
DataInputStream dis = new DataInputStream(new FileInputStream(metaFile));
301303

302304
try {
305+
// do it as first element - shure how many bytes we read..
306+
this.hopList = ASAPSerialization.readASAPHopList(dis);
307+
303308
this.uri = dis.readUTF();
304309
this.setExtraByString(dis.readUTF());
305310
}
306-
catch(EOFException eof) {
311+
catch(EOFException | ASAPException eof) {
307312
// file empty
308313
return false;
309314
}
@@ -316,10 +321,9 @@ private boolean readMetaData(File metaFile) throws IOException {
316321
String offsetList = dis.readUTF();
317322
this.messageStartOffsets = this.messageOffsetString2List(offsetList);
318323
}
319-
catch(IOException ioe) {
324+
catch(IOException e) {
320325
// no more data - ok
321-
}
322-
finally {
326+
} finally {
323327
dis.close();
324328
}
325329

@@ -329,6 +333,9 @@ private boolean readMetaData(File metaFile) throws IOException {
329333
private void writeMetaData(File metaFile) throws IOException {
330334
// write data to metafile
331335
DataOutputStream dos = new DataOutputStream(new FileOutputStream(metaFile));
336+
337+
// do it as first element - shure how many bytes we read..
338+
ASAPSerialization.writeASAPHopList(this.hopList, dos);
332339

333340
dos.writeUTF(this.uri);
334341
dos.writeUTF(this.getExtraAsString());

0 commit comments

Comments
 (0)