📄 bytearraymessageelement.html
字号:
<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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#getByteLength()">getByteLength</A></B>()</CODE><BR> Returns the size of the element data in bytes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#getBytes()">getBytes</A></B>()</CODE><BR> Returns the contents of this element as a byte array. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#getBytes(boolean)">getBytes</A></B>(boolean copy)</CODE><BR> Returns a byte array which contains the element data. The byte array returned <b>may be shared amongst all copies of the element</b>, do not modify it. The <code>copy</code> parameter allows you to request a private, modifiable copy of the element data. <p/>This implementation builds the byte array from the stream. <p/>synchronized so that we can replace our internal buffer with the buffer we are returning if we were using a shared buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.io.InputStream</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#getStream()">getStream</A></B>()</CODE><BR> Returns the stream of bytes which represents the content of this <code>Document</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#hashCode()">hashCode</A></B>()</CODE><BR> </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#sendToStream(java.io.OutputStream)">sendToStream</A></B>(java.io.OutputStream sendTo)</CODE><BR> 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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../net/jxta/endpoint/ByteArrayMessageElement.html#toString()">toString</A></B>()</CODE><BR> <p/>Returns a String representation of the element data. The <code>'charset'</code> parameter of the message element's mimetype, if any, is used to determine encoding. If the charset specified is unsupported then the default enconding will be used. <p/>synchronized for caching purposes. Returns the string representation of this element. </TD></TR></TABLE> <A NAME="methods_inherited_from_class_net.jxta.endpoint.MessageElement"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class net.jxta.endpoint.<A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../net/jxta/endpoint/MessageElement.html#clone()">clone</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#copyInputStreamToOutputStream(java.io.InputStream, java.io.OutputStream)">copyInputStreamToOutputStream</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getElementName()">getElementName</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getElementProperty(java.lang.Object)">getElementProperty</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getFileExtension()">getFileExtension</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getMimeType()">getMimeType</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getSequentialName()">getSequentialName</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getSignature()">getSignature</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#getUniqueName()">getUniqueName</A>, <A HREF="../../../net/jxta/endpoint/MessageElement.html#setElementProperty(java.lang.Object, java.lang.Object)">setElementProperty</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>finalize, getClass, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="b"><!-- --></A><H3>b</H3><PRE>protected byte[] <B>b</B></PRE><DL><DD>The bytes of this element.<P><DL></DL></DL><HR><A NAME="offset"><!-- --></A><H3>offset</H3><PRE>protected int <B>offset</B></PRE><DL><DD>This is the offset of our data within the array<P><DL></DL></DL><HR><A NAME="len"><!-- --></A><H3>len</H3><PRE>protected int <B>len</B></PRE><DL><DD>length of the element data. sometimes the same as b.length, but may be lesser.<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="ByteArrayMessageElement()"><!-- --></A><H3>ByteArrayMessageElement</H3><PRE>protected <B>ByteArrayMessageElement</B>()</PRE><DL><DD>non-public constructor<P></DL><HR><A NAME="ByteArrayMessageElement(java.lang.String, net.jxta.document.MimeMediaType, byte[], net.jxta.endpoint.MessageElement)"><!-- --></A><H3>ByteArrayMessageElement</H3><PRE>public <B>ByteArrayMessageElement</B>(java.lang.String name, <A HREF="../../../net/jxta/document/MimeMediaType.html" title="class in net.jxta.document">MimeMediaType</A> type, byte[] b, <A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A> sig)</PRE><DL><DD>Create a new Message Element. The contents of the provided byte array are <b>not</b> copied during construction.<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>b</CODE> - A byte array containing the contents of this element.<DD><CODE>sig</CODE> - optional message digest/digital signature elemnent or null if no signature is desired.</DL><HR><A NAME="ByteArrayMessageElement(java.lang.String, net.jxta.document.MimeMediaType, byte[], int, net.jxta.endpoint.MessageElement)"><!-- --></A><H3>ByteArrayMessageElement</H3><PRE>public <B>ByteArrayMessageElement</B>(java.lang.String name, <A HREF="../../../net/jxta/document/MimeMediaType.html" title="class in net.jxta.document">MimeMediaType</A> type, byte[] b, int offset, <A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A> sig)</PRE><DL><DD>Create a new MessageElement, The contents of the provided byte array are <b>not</b> copied during construction.<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>b</CODE> - A byte array containing the contents of this element.<DD><CODE>offset</CODE> - all bytes before this location in <code>b</code> will be ignored.<DD><CODE>sig</CODE> - optional message digest/digital signature elemnent or null if no signature is desired.</DL><HR><A NAME="ByteArrayMessageElement(java.lang.String, net.jxta.document.MimeMediaType, byte[], int, int, net.jxta.endpoint.MessageElement)"><!-- --></A><H3>ByteArrayMessageElement</H3><PRE>public <B>ByteArrayMessageElement</B>(java.lang.String name, <A HREF="../../../net/jxta/document/MimeMediaType.html" title="class in net.jxta.document">MimeMediaType</A> type, byte[] b, int offset, int len, <A HREF="../../../net/jxta/endpoint/MessageElement.html" title="class in net.jxta.endpoint">MessageElement</A> sig)</PRE><DL><DD>Create a new Element, but dont add it to the message. The contents of the byte array are <b>not</b> copied during construction.<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>b</CODE> - A byte array containing the contents of this Element.<DD><CODE>offset</CODE> - all bytes before this location will be ignored.<DD><CODE>len</CODE> - number of bytes to include<DD><CODE>sig</CODE> - optional message digest/digital signature elemnent or null if no signature is desired.</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -