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

Regression in XMLMemMapperBuffer #8

Open
bdecarne opened this issue Feb 11, 2017 · 1 comment
Open

Regression in XMLMemMapperBuffer #8

bdecarne opened this issue Feb 11, 2017 · 1 comment

Comments

@bdecarne
Copy link

Hi there,

This code works as expected in 2.11 :

VTDGenHuge vgh = new VTDGenHuge();
if (vgh.parseFile("c:/xml/text1.xml",true , VTDGenHuge.MEM_MAPPED)) {
     VTDNavHuge vnh = vgh.getNav();
     vnh.toElement(VTDNavHuge.FC);
     long[] la = vnh.getElementFragment();
     vnh.getXML().writeToFileOutputStream(new FileOutputStream("c:/xml/text2.xml"), la[0], la[1]);
}

But since 2.12, it raise this error :

java.nio.channels.ClosedChannelException
	at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:110)
	at sun.nio.ch.FileChannelImpl.transferTo(FileChannelImpl.java:588)
	at com.ximpleware.extended.XMLMemMappedBuffer.writeToFileOutputStream(XMLMemMappedBuffer.java:104)

The line https://github.com/jzhang2004/vtd-xml/blob/master/ximple-dev/com/ximpleware/extended/VTDGenHuge.java#L927 close the FileChannel at the end of vgh.getNav();

Have a nice day !

@jzhang2004
Copy link
Owner

jzhang2004 commented Feb 21, 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