jdbf icon indicating copy to clipboard operation
jdbf copied to clipboard

Exception in thread "main" java.io.IOException: Resetting to invalid mark - on getMemoAsString()

Open Xachman opened this issue 9 years ago • 4 comments

I dont know for sure what version of FoxPro my client is running but its old and the type meta data gives me a value of FoxPro2x.

I got this error when using getMemoAsString(); it would show the first entry then fail on the second entry. After some debugging and googling I realized that BufferedInputStream would throw this error if the skip() value was greater then the buffer size. BUFFER_SIZE in the MemoReader is set at 8192 and memoHeader.getBlockSize()*offsetInBlocks was giving me huge numbers like 18510208. Now I didnt do well in school but 18510208 is greater then 8192. So, I set the BUFFER_SIZE to 185102080 and it went threw with no errors.

Now This is probably not the best solution to the problem but I wanted to mention it. Maybe there should be a set method for the buffer size.

Xachman avatar Feb 10 '16 12:02 Xachman

Im working on fix to this in my fork here https://github.com/Xachman/jdbf

Xachman avatar Mar 03 '16 11:03 Xachman

Can you please send me FoxPro file which causes this fail? To: iryndin At gmail dot com. I have some time to work on this issue now.

iryndin avatar Mar 03 '16 11:03 iryndin

Hi files are sent. I wanted to mention my current solution to this in the fork is to open and close the input stream in the MemoReader class in the read function. this seems to have solved the problem for me and the data is accurate, as far as I can tell, with the foxpro application I have running. Im building an importer to couchdb with this right now

For now the only way I was able to make this possible is to limit the arguments you can pass in to file objects.

Xachman avatar Mar 04 '16 01:03 Xachman

No but I did fork the project you can try that fork out and see if my fix works for you.


From: Cristina Sarasua [email protected] Sent: Friday, November 17, 2017 6:42 AM To: iryndin/jdbf Cc: Xachman; Author Subject: Re: [iryndin/jdbf] Exception in thread "main" java.io.IOException: Resetting to invalid mark - on getMemoAsString() (#22)

hello, I also get this error. Is this issue solved?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/iryndin/jdbf/issues/22#issuecomment-345222132, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AHV1blf6TaWmrm-mF6yv9vnOH_7J_TQKks5s3XEQgaJpZM4HXPlu.

Xachman avatar Nov 22 '17 03:11 Xachman