On Mar 26, 7:19 pm, "opalpa opa...@gmail.com http://opalpa.info"
<opa...@gmail.com> wrote:
> > The .so must be loaded from the "real" filesystem, you can't load it
> > from inside the ear file.
[quoted text clipped - 8 lines]
> opalpa
> opa...@gmail.comhttp://opalpa.info/
Ok, I am going to try and give this method a shot. I haven't worked
with file io and input/output streams.
--code--
File file = File.createTempFile("sapjcotest", ".so");
file.deleteOnExit();
InputStream inStream =
ClassLoader.getSystemClassLoader().getResourceAsStream("/opt/was51/
AppServer/installedApps/WAS51TST/esstst4.ear/esstst4web.war/WEB-INF/
lib/libsapjcorfc.so");
BufferedWriter out = new BufferedWriter(new FileWriter(file));
out.write(inStream.hashCode());
out.close();
System.load(file.getCanonicalPath());
--code--
I'm fairly confident that I have it started the right way.. The
inStream object is always null and even if that did work, I can't
figure out how to write that stream to the BufferedWriter object.
Could you assist with that?
Thanks again for your help.
Gordon Beaton - 28 Mar 2007 21:05 GMT
> I'm fairly confident that I have it started the right way.. The
> inStream object is always null and even if that did work, I can't
> figure out how to write that stream to the BufferedWriter object.
> Could you assist with that?
I can't say why your inputStream is null from the example.
However, don't *ever* use Readers or Writers for binary data! You will
corrupt the file. Read from the InputStream until you reach EOF,
writing each chunk to an OutputStream (e.g. a FileOutputStream).
/gordon
--