Re: Close the Stream

sandeepK <[email protected]> Wed, 5 Oct 2005 08:00:54 +0530
Newsgroups gmane.comp.java.sun.servlet
Message-ID <001201c5c954$cf823520$ad05030a@ccxhallsk>
This is a multi-part message in MIME format.

------=_NextPart_000_000F_01C5C982.E9334530
Content-Type: text/plain;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

no not necessarily.


The more you sweat in peace the less you bleed in war

Sandeep Katiyar
Senior Engineer
ITX/HEEP/BHEL/Haridwar/Uttaranchal /india
+919412070340(MOBILE)
01334265090(HOME)
01334285260(OFFICE)
I am parked on the internet at http://skatiyar.com


  ----- Original Message -----=20
  From: Chris Pratt=20
  To: [email protected]=20
  Sent: Wednesday, October 05, 2005 2:54 AM
  Subject: Re: Close the Stream


  Nope.  I always do out of habit and because I consider it cleaner =
code, but it is the Servlet Engine's responsibility to close the stream =
if you don't.
    (*Chris*)


  On 10/4/05, SUBSCRIBE EJB-INTEREST anonymous <[email protected]> wrote:
    Hi,
    I use HttpServletResponse's getOutputStream().println(String) to =
print a
    message in servlet.
    My question is do I have to close the stream before leaving the =
method.
    If not,will it impact the performance.

    Thanks in advance,

    =
_________________________________________________________________________=
__
    To unsubscribe, send email to [email protected] and include in =
the body=20
    of the message "signoff SERVLET-INTEREST".

    Archives: =
http://archives.java.sun.com/archives/servlet-interest.html
    Resources: =
http://java.sun.com/products/servlet/external-resources.html
    LISTSERV Help: http://www.lsoft.com/manuals/user/user.html=20


  =
_________________________________________________________________________=
__ To unsubscribe, send email to [email protected] and include in =
the body of the message "signoff SERVLET-INTEREST".=20
  Archives: http://archives.java.sun.com/archives/servlet-interest.html =
Resources: http://java.sun.com/products/servlet/external-resources.html =
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html=20


___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


------=_NextPart_000_000F_01C5C982.E9334530
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>no not necessarily.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>The more you sweat in peace the less =
you bleed in=20
war</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Sandeep Katiyar<BR>Senior=20
Engineer<BR>ITX/HEEP/BHEL/Haridwar/Uttaranchal=20
/india<BR>+919412070340(MOBILE)<BR>01334265090(HOME)<BR>01334285260(OFFIC=
E)<BR>I=20
am parked on the internet at <A=20
href=3D"http://skatiyar.com">http://skatiyar.com</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A [email protected] =
href=3D"mailto:[email protected]">Chris=20
  Pratt</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A=20
  [email protected]=20
  =
href=3D"mailto:[email protected]">[email protected]=
OM</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, October 05, =
2005 2:54=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: Close the =
Stream</DIV>
  <DIV><BR></DIV>Nope.&nbsp; I always do out of habit and because I =
consider it=20
  cleaner code, but it is the Servlet Engine's responsibility to close =
the=20
  stream if you don't.<BR>&nbsp; (*Chris*)<BR><BR>
  <DIV><SPAN class=3Dgmail_quote>On 10/4/05, <B =
class=3Dgmail_sendername>SUBSCRIBE=20
  EJB-INTEREST anonymous</B> &lt;<A=20
  href=3D"mailto:[email protected]">[email protected]</A>&gt; =
wrote:</SPAN>
  <BLOCKQUOTE class=3Dgmail_quote=20
  style=3D"PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: =
rgb(204,204,204) 1px solid">Hi,<BR>I=20
    use HttpServletResponse's getOutputStream().println(String) to print =

    a<BR>message in servlet.<BR>My question is do I have to close the =
stream=20
    before leaving the method.<BR>If not,will it impact the=20
    performance.<BR><BR>Thanks in=20
    =
advance,<BR><BR>_________________________________________________________=
__________________<BR>To=20
    unsubscribe, send email to <A=20
    href=3D"mailto:[email protected]">[email protected]</A> and =
include in=20
    the body <BR>of the message "signoff =
SERVLET-INTEREST".<BR><BR>Archives: <A=20
    =
href=3D"http://archives.java.sun.com/archives/servlet-interest.html">http=
://archives.java.sun.com/archives/servlet-interest.html</A><BR>Resources:=
=20
    <A=20
    =
href=3D"http://java.sun.com/products/servlet/external-resources.html">htt=
p://java.sun.com/products/servlet/external-resources.html</A><BR>LISTSERV=
=20
    Help: <A=20
    =
href=3D"http://www.lsoft.com/manuals/user/user.html">http://www.lsoft.com=
/manuals/user/user.html=20
    =
</A><BR></BLOCKQUOTE></DIV><BR>__________________________________________=
_________________________________=20
  To unsubscribe, send email to [email protected] and include in the =
body of=20
  the message "signoff SERVLET-INTEREST".=20
  <P>Archives: =
http://archives.java.sun.com/archives/servlet-interest.html=20
  Resources: =
http://java.sun.com/products/servlet/external-resources.html=20
  LISTSERV Help: http://www.lsoft.com/manuals/user/user.html=20
  <P></P></BLOCKQUOTE></BODY></HTML>
___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".
<p>
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
<p>

------=_NextPart_000_000F_01C5C982.E9334530--