📄 inputstreammessageelement.html
字号:
<A NAME="databytes"><!-- --></A><H3>databytes</H3><PRE>protected java.util.List <B>databytes</B></PRE><DL><DD>The bytes of this element.<P><DL></DL></DL><HR><A NAME="length"><!-- --></A><H3>length</H3><PRE>protected long <B>length</B></PRE><DL><DD>The length of the data.<P><DL></DL></DL><HR><A NAME="cachedHashCode"><!-- --></A><H3>cachedHashCode</H3><PRE>protected transient int <B>cachedHashCode</B></PRE><DL><DD>Cached Hash Code<P><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="InputStreamMessageElement()"><!-- --></A><H3>InputStreamMessageElement</H3><PRE>protected <B>InputStreamMessageElement</B>()</PRE><DL><DD>non-public constructor.<P></DL><HR><A NAME="InputStreamMessageElement(java.lang.String, net.jxta.document.MimeMediaType, java.io.InputStream, net.jxta.endpoint.MessageElement)"><!-- --></A><H3>InputStreamMessageElement</H3><PRE>public <B>InputStreamMessageElement</B>(java.lang.String name, <A HREF="../../../net/jxta/document/MimeMediaType.html" title="class in net.jxta.document">MimeMediaType</A> type, java.io.InputStream in, <A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A> sig) throws java.io.IOException</PRE><DL><DD>Create a new MessageElement. This constructor copies the data as needed and closes the stream upon completion. If the stream does not support the "mark" operation then the data is copied immediately and the stream will be closed.<P><DT><B>Parameters:</B><DD><CODE>name</CODE> - Name of the MessageElement. May be the empty string ("") if the MessageElement is not named.<DD><CODE>type</CODE> - Type of the MessageElement. null is the same as specifying the type "Application/Octet-stream".<DD><CODE>in</CODE> - the stream containing the body of the MessageElement. The stream will be closed by the MessageElement.<DD><CODE>sig</CODE> - optional message digest/digital signature elemnent or null if no signature is desired.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - If there is a problem reading from the source stream.</DL><HR><A NAME="InputStreamMessageElement(java.lang.String, net.jxta.document.MimeMediaType, java.io.InputStream, long, net.jxta.endpoint.MessageElement)"><!-- --></A><H3>InputStreamMessageElement</H3><PRE>public <B>InputStreamMessageElement</B>(java.lang.String name, <A HREF="../../../net/jxta/document/MimeMediaType.html" title="class in net.jxta.document">MimeMediaType</A> type, java.io.InputStream in, long len, <A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A> sig) throws java.io.IOException</PRE><DL><DD>Create a new Message Element.<P><DT><B>Parameters:</B><DD><CODE>name</CODE> - Name of the MessageElement. May be the empty string ("") if the MessageElement is not named.<DD><CODE>type</CODE> - Type of the MessageElement. null is the same as specifying the type "Application/Octet-stream".<DD><CODE>in</CODE> - the stream containing the body of the MessageElement. The stream will <b>NOT</b> be closed unless EOF is unexpectedly reached.<DD><CODE>len</CODE> - The size of the Element will be limited to len bytes from the stream. If you are using the stream interface and know the size of the stream, specifying it here improves performance and space effciency a lot. The stream must contain at least <code>len</code> bytes.<DD><CODE>sig</CODE> - optional message digest/digital signature elemnent or null if no signature is desired.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is a problem reading from the source stream</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(java.lang.Object target)</PRE><DL><DD> <p/>Elements are considered equal if they have the same name, type and signatures. Element data is not considered by this implementation as it is mostly intended for subclass use.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html#equals(java.lang.Object)">equals</A></CODE> in class <CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="hashCode()"><!-- --></A><H3>hashCode</H3><PRE>public int <B>hashCode</B>()</PRE><DL><DD><P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html#hashCode()">hashCode</A></CODE> in class <CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getByteLength()"><!-- --></A><H3>getByteLength</H3><PRE>public long <B>getByteLength</B>()</PRE><DL><DD>Returns the size of the element data in bytes.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html#getByteLength()">getByteLength</A></CODE> in class <CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>long containing the size of the element data.</DL></DD></DL><HR><A NAME="getStream()"><!-- --></A><H3>getStream</H3><PRE>public java.io.InputStream <B>getStream</B>() throws java.io.IOException</PRE><DL><DD>Returns the stream of bytes which represents the content of this <code>Document</code>.<P><DD><DL><DT><B>Returns:</B><DD>An <CODE>InputStream</CODE> containing the bytes of this <code>Document</code>.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an I/O error occurs.</DL></DD></DL><HR><A NAME="sendToStream(java.io.OutputStream)"><!-- --></A><H3>sendToStream</H3><PRE>public void <B>sendToStream</B>(java.io.OutputStream sendTo) throws java.io.IOException</PRE><DL><DD>Send the contents of this <code>Document</code> to the specified stream. <p/>This version probably has sub-optimal performance. Sub-classes should override this implementation.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../net/jxta/document/Document.html#sendToStream(java.io.OutputStream)">sendToStream</A></CODE> in interface <CODE><A HREF="../../../net/jxta/document/Document.html" title="interface in net.jxta.document">Document</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html#sendToStream(java.io.OutputStream)">sendToStream</A></CODE> in class <CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE></DL></DD></DL><HR><A NAME="CopyToDataBytes(java.io.InputStream, long)"><!-- --></A><H3>CopyToDataBytes</H3><PRE>protected java.util.List <B>CopyToDataBytes</B>(java.io.InputStream in, long limit) throws java.io.IOException</PRE><DL><DD>Copy data from a stream with best possible effciency. Unfortunately, this still results in a lot of copying since we have often have no fore-knowledge of the length of the stream.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>in</CODE> - the stream to copy from<DD><CODE>limit</CODE> - the maximum number of bytes to copy from the stream. Long.LONG_MAX will read until EOF.<DT><B>Returns:</B><DD>an array of byte arrays containing the data.<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if there is a problem reading from the stream.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InputStreamMessageElement.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>JXTA J2SE</EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../net/jxta/endpoint/EndpointAddress.html" title="class in net.jxta.endpoint"><B>PREV CLASS</B></A> <A HREF="../../../net/jxta/endpoint/Message.html" title="class in net.jxta.endpoint"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="InputStreamMessageElement.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -