Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Xachman opened this issue Feb 10, 2016 · 4 comments

Comments

@Xachman
Copy link

Xachman commented Feb 10, 2016

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
Copy link
Author

Xachman commented Mar 3, 2016

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

@iryndin
Copy link
Owner

iryndin commented Mar 3, 2016

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.

@Xachman
Copy link
Author

Xachman commented Mar 4, 2016

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
Copy link
Author

Xachman commented Nov 22, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants