The reason is so simple ,you are constructing the
byte array but you are not storing any contents in it.
try this code it will work.
File file = new File("./public_html/xml/cc.xml");
FileInputStream fis = new FileInputStream(file);
byte[] data = new byte[fis.available()];
fis.read(data,0,fis.available());
String strData = new String(data);
out.println(strData);
--- Ashwani Kalra <[EMAIL PROTECTED]> wrote:
> Instead of using the available method try using some
> other function to read
> bytes and then check it.
>
> Ashwani
>
> > ----------
> > From: Paul Beer
> > Reply To: [EMAIL PROTECTED]
> > Sent: Saturday, February 26, 2000 1:08 AM
> > To: [EMAIL PROTECTED]
> > Subject: outputting a fileinputstream
> >
> > I am trying to load an xml packet off a local
> directory and display it in
> > a
> > jsp template... to no avail... could someone lok
> at this code and let me
> > know why it displays nothing ? when i do a
> string.length() i get 3451 so
> > I
> > know it is reading the stream... I just cant
> output it in JSP.
> >
> > thanks,
> > paul
> >
> > code:
> >
> > File file = new File("./public_html/xml/cc.xml");
> > FileInputStream fis = new FileInputStream(file);
> > byte[] data = new byte[fis.available()];
> > String strData = new String(data);
> > out.println(strData);
> >
> >
>
==========================================================================
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff
> > JSP-INTEREST".
> > FAQs on JSP can be found at:
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> >
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html