the archives has a lot of discussion about I/O in EJB look them.

--
  Claudio Miranda
  ___________________________________


Olivier Duhart wrote:
>
> I want to load the content of a file from my ejb jar file. I try this
> piece of code :
>
> private void test() {
>     System.out.println("test()");
>     try {
>         java.io.InputStream oStream =
> this.getClass().getResourceAsStream("dummy.txt");
>         int oRead = 0;
>         byte[] oBuffer = new byte[1024];
>         String oContent = "";
>         while (oRead != -1) {
>             oRead = oStream.read(oBuffer);
>             if (oRead > 0) {
>                 oContent += new String(oBuffer,0,oRead);
>             }
>         }
>         oStream.close();
>         System.out.println("content = " + oContent);
>     }
>     catch(Exception e) {
>         e.printStackTrace();
>     }
> }
>
> It works well (with JBoss) but my question is : Am I allowed to do this
> ?
>
> Thanks
>
> Olivier
>
> --
> Olivier Duhart
> Wokup! - Product Team
> [EMAIL PROTECTED]
> +33 299 844 412
>
> --
> Olivier Duhart

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to