|
From: Patrick Y. <kc...@ce...> - 2003-07-02 06:43:36
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
The current implementation of getContentLength() is created for one
purpose: to report number of bytes in that payload without counting the
input stream byte by byte. The only possible way to do this is by
calculations on the pointers stored in AttachmentDataSource. We have a
dillema here. Actually we can count the bytes in InputStream here...
but it will be too time consuming for large payloads. Another concern
is that we are not able to consider the Content-Transfer-Encoding here.
The encoding to be used is not known until the point real sending takes
place...<br>
<br>
Basically, I agree to create a getActualContentLength() method. But I
am worried about the confusion with getContentLength(). <br>
<br>
Regards, -Patrick<br>
<br>
<br>
<br>
<br>
Mayne, Peter wrote:<br>
<blockquote type="cite"
cite="mid...@s-...">
<meta http-equiv="Content-Type" content="text/html; ">
<title>Message</title>
<meta content="MSHTML 6.00.2800.1141" name="GENERATOR">
<div><span class="387104023-26062003"><font face="Arial" size="2">The
Javadoc for PayloadContainer.getContentLength() says:</font></span><span
class="387104023-26062003"></span></div>
<div><font color="#3f5fbf" size="2"> </font></div>
<font size="2"> </font>
<div><font face="Arial"><font color="#3f5fbf" size="2">Get</font><font
size="2"> </font><font color="#3f5fbf" size="2">the</font><font
size="2"> </font><font color="#3f5fbf" size="2">content</font><font
size="2"> </font><font color="#3f5fbf" size="2">length</font><font
size="2"> </font><font color="#3f5fbf" size="2">of</font><font size="2"> </font><font
color="#3f5fbf" size="2">this</font><font size="2"> </font><font
color="#3f5fbf" size="2">payload.</font><font size="2"> </font><font
color="#3f5fbf" size="2">Note</font><font size="2"> </font><font
color="#3f5fbf" size="2">that</font><font size="2"> </font><font
color="#3f5fbf" size="2">the</font><font size="2"> </font><font
color="#3f5fbf" size="2">content</font><font size="2"> </font><font
color="#3f5fbf" size="2">length</font></font><font size="2"> </font></div>
<div><font face="Arial"><font color="#3f5fbf" size="2">returned</font><font
size="2"> </font><font color="#3f5fbf" size="2">will</font><font
size="2"> </font><font color="#3f5fbf" size="2">be</font><font size="2"> </font><font
color="#7f7f9f" size="2">-</font><font color="#3f5fbf" size="2">1</font><font
size="2"> </font><font color="#3f5fbf" size="2">if</font><font size="2"> </font><font
color="#3f5fbf" size="2">this</font><font size="2"> </font><font
color="#3f5fbf" size="2">container</font><font size="2"> </font><font
color="#3f5fbf" size="2">is</font><font size="2"> </font><font
color="#3f5fbf" size="2">not</font><font size="2"> </font><font
color="#3f5fbf" size="2">created</font><font size="2"> </font><font
color="#3f5fbf" size="2">from</font></font><font size="2"> </font></div>
<div><font face="Arial"><font color="#3f5fbf" size="2">AttachmentDataSource.</font><font
size="2"> </font><font color="#3f5fbf" size="2">Also,</font><font
size="2"> </font><font color="#3f5fbf" size="2">the</font><font
size="2"> </font><font color="#3f5fbf" size="2">length</font><font
size="2"> </font><font color="#3f5fbf" size="2">returned</font><font
size="2"> </font><font color="#3f5fbf" size="2">does</font><font
size="2"> </font><font color="#3f5fbf" size="2">not</font><font
size="2"> </font><font color="#3f5fbf" size="2">take</font></font><font
size="2"> </font></div>
<div><font face="Arial"><font color="#3f5fbf" size="2">Content</font><font
color="#7f7f9f" size="2">-</font><font color="#3f5fbf" size="2">Transfer</font><font
color="#7f7f9f" size="2">-</font><font color="#3f5fbf" size="2">Encoding</font><font
size="2"> </font><font color="#3f5fbf" size="2">into</font><font
size="2"> </font><font color="#3f5fbf" size="2">account,</font><font
size="2"> </font><font color="#3f5fbf" size="2">if</font><font size="2"> </font></font><font
color="#3f5fbf" size="2"><font face="Arial">any.</font></font></div>
<div> </div>
<div><font face="Arial" size="2"><span class="387104023-26062003">I'm
getting a content length of -1, so I'll believe it. :-)</span></font></div>
<div><font face="Arial" size="2"><span class="387104023-26062003"></span></font> </div>
<div><font face="Arial" size="2"><span class="387104023-26062003">So
it seems the only way to do this properly would be <font size="2">.getDataHandler().getInputStream()
and count the bytes. However, if by "if we can prevent loading the
documents" you mean "we don't mind if someone else loads the
documents", not a problem. :-)</font></span></font></div>
<div><font face="Arial" size="2"><span class="387104023-26062003"></span></font> </div>
<div><font face="Arial" size="2"><span class="387104023-26062003">Would
it be sufficient to provide a getActualContentLength() that loads and
counts bytes?</span></font></div>
<div><font face="Arial" size="2"><span class="387104023-26062003"></span></font> </div>
<div><font face="Arial" size="2"><span class="387104023-26062003">Would
you also want a EbxmlMessage.getActualPayloadLength() to return the
sum of all payload container lengths?</span></font></div>
<div> </div>
<div><span class="387104023-26062003"><font face="Arial" size="2">(Better
name suggestions anyone?)</font></span></div>
<div><span class="387104023-26062003"></span> </div>
<div><span class="387104023-26062003"><font face="Arial" size="2">PJDM</font></span></div>
<!-- Converted from text/plain format -->
<div><font face="Arial" size="2">--<br>
Peter Mayne<br>
Technology Consultant<br>
Spherion Technology Solutions<br>
Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602<br>
T: 61 2 62689727 F: 61 2 62689777 </font></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 0); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div class="OutlookMessageHeader" lang="en-us" dir="ltr"
align="left"><font face="Tahoma" size="2">-----Original Message-----<br>
<b>From:</b> Ronald van Kuijk [<a class="moz-txt-link-freetext" href="mailto:rv...@ab...">mailto:rv...@ab...</a>] <br>
<b>Sent:</b> Thursday, 26 June 2003 8:14 PM<br>
<b>To:</b> '<a class="moz-txt-link-abbreviated" href="mailto:ebx...@li...">ebx...@li...</a>'<br>
<b>Subject:</b> RE: [ebxmlms-develop] getDescriptionCount() et al
(similar to get PayloadCount())<br>
<br>
</font></div>
<div><span class="644384809-26062003"><font face="Arial"
color="#0000ff" size="2">The total size of all attachments
(unencoded)</font></span></div>
<div><span class="644384809-26062003"></span> </div>
<div><span class="644384809-26062003"><font face="Arial"
color="#0000ff" size="2">We partly base billing on this and if we
can prevent loading the documents that would be great</font></span></div>
<div><span class="644384809-26062003"></span> </div>
<div><span class="644384809-26062003"><font face="Arial"
color="#0000ff" size="2">Ronald</font></span></div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px;">
<div class="OutlookMessageHeader" dir="ltr" align="left"><font
face="Tahoma" size="2">-----Oorspronkelijk bericht-----<br>
<b>Van:</b> Patrick Yee [<a class="moz-txt-link-freetext" href="mailto:kc...@ce...">mailto:kc...@ce...</a>]<br>
<b>Verzonden:</b> donderdag 26 juni 2003 9:40<br>
<b>Aan:</b> <a class="moz-txt-link-abbreviated" href="mailto:ebx...@li...">ebx...@li...</a><br>
<b>Onderwerp:</b> Re: [ebxmlms-develop] getDescriptionCount()
et al (similar to get PayloadCount())<br>
<br>
</font></div>
Do you want to get the size of a particular payload? or to get
number of payloads in a message? -Patrick<br>
<br>
Ronald van Kuijk wrote:<br>
<blockquote
cite="mid...@po..."
type="cite">
<meta content="MSHTML 5.50.4916.2300" name="GENERATOR">
<div><span class="214561907-26062003"><font face="Arial"
color="#0000ff" size="2">If it's that easy for you ;-) I got one to...
(didn't look if it's already there) </font></span></div>
<div><span class="214561907-26062003"></span> </div>
<div><span class="214561907-26062003"><font face="Arial"
color="#0000ff" size="2">getPayloadSize()</font></span></div>
<blockquote dir="ltr"
style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div class="OutlookMessageHeader" dir="ltr" align="left"><font
face="Tahoma" size="2">-----Oorspronkelijk bericht-----<br>
<b>Van:</b> Mayne, Peter [<a class="moz-txt-link-freetext"
href="mailto:Pet...@ap...">mailto:Pet...@ap...</a>]<br>
<b>Verzonden:</b> donderdag 26 juni 2003 8:17<br>
<b>Aan:</b> '<a class="moz-txt-link-abbreviated"
href="mailto:ebx...@li...">ebx...@li...</a>'<br>
<b>Onderwerp:</b> [ebxmlms-develop] getDescriptionCount() et
al (similar to getPayloadCount())<br>
<br>
</font></div>
<p><font size="2">Can we please add a getDescriptionCount()
to MessageHeader and Reference, analagous to getPayloadCount()
in EbxmlMessage?</font></p>
<p><font size="2">Similarly for any other ArrayList-type
elements that return Iterators. The code I'm writing would
find it highly convenient.</font></p>
<p><font size="2">If you're agreeable, I'm happy to do it.
It's not that hard, even for me. :-)</font> </p>
<p><font size="2">Thanks.</font> </p>
<p><font size="2">PJDM</font> <br>
<font size="2">-- </font><br>
<font size="2">Peter Mayne</font> <br>
<font size="2">Technology Consultant</font> <br>
<font size="2">Spherion Technology Solutions</font> <br>
<font size="2">Level 1, 243 Northbourne Avenue, Lyneham, ACT,
2602</font> <br>
<font size="2">T: 61 2 62689727 F: 61 2 62689777</font> </p>
<font color="blue" size="3">
<pre>The information contained in this email and any attachments to it:
(a) may be confidential and if you are not the intended recipient, any interference with,
use, disclosure or copying of this material is unauthorised and prohibited; and
(b) may contain personal information of the recipient and/or the sender as defined
under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to
collect, hold and use such information and any personal information contained in a
response to this email, for any reasonable purpose in the ordinary course of
Spherion's
business, including forwarding this email internally or disclosing it to a third party. All
personal information collected by Spherion will be handled in accordance with
Spherion's Privacy Policy. If you have received this email in error, please notify the
sender and delete it.
(c) you agree not to employ or arrange employment for any candidate(s) supplied in
this email and any attachments without first entering into a contractual agreement with
Spherion. You further agree not to divulge any information contained in this document
to any person(s) or entities without the express permission of Spherion.
</pre>
</font></blockquote>
</blockquote>
------------------------------------------------------- This
SF.Net email is sponsored by: INetU Attention Web Developers &
Consultants: Become An INetU Hosting Partner. Refer Dedicated Servers.
We Manage Them. You Get 10% Monthly Commission! INetU Dedicated
Managed Hosting <a class="moz-txt-link-freetext" href="http://www.inetu.net/partner/index.php">http://www.inetu.net/partner/index.php</a>
_______________________________________________ ebxmlms-develop mailing
list <a class="moz-txt-link-abbreviated" href="mailto:ebx...@li...">ebx...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/ebxmlms-develop">https://lists.sourceforge.net/lists/listinfo/ebxmlms-develop</a></blockquote>
</blockquote>
</blockquote>
</body>
</html>
|