Reputation: 22011
I need to lower my received sequence number for performing FIX certification to check the gap fill/resend works.
I tried editing the number but now I get EOF Exception
whenever I launch my app.
The format of the sequence number file is a bit weird:
^@^C7:4
Any idea how to do this?
Thanks.
Upvotes: 2
Views: 2465
Reputation: 1
You can use the file.readUTF() to print the sequence number string.
RandomAccessFile seqFile = new RandomAccessFile("/Users/jacky/test.seqnums", "r");
System.out.println(seqFile.readUTF());
seqFile.close();
Upvotes: 0
Reputation: 22011
public static void main(String[] args) throws IOException {
int senderSequenceNumber=1910;
int targetSequenceNumber=2268;
RandomAccessFile file = new RandomAccessFile("C:\\filename.seqnums", "rw");
file.seek(0);
file.writeUTF("" + senderSequenceNumber + ':'+ targetSequenceNumber);
}
This is adapted from quickfix.FileStore
Upvotes: 4