<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <TITLE> Client </TITLE> <META NAME="keywords" CONTENT="processing.net.Client class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Client"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_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="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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../processing/net/Server.html" title="class in processing.net"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?processing/net/Client.html" target="_top"><B>FRAMES</B></A> <A HREF="Client.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_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> processing.net</FONT> <BR> Class Client</H2> <PRE> java.lang.Object <IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>processing.net.Client</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.lang.Runnable</DD> </DL> <HR> <DL> <DT><PRE>public class <B>Client</B><DT>extends java.lang.Object<DT>implements java.lang.Runnable</DL> </PRE> <P> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </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="../../processing/net/Client.html#input">input</A></B></CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.OutputStream</CODE></FONT></TD> <TD><CODE><B><A HREF="../../processing/net/Client.html#output">output</A></B></CODE> <BR> </TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../processing/net/Client.html#Client(processing.core.PApplet, java.net.Socket)">Client</A></B>(<A HREF="../../processing/core/PApplet.html" title="class in processing.core">PApplet</A> parent, java.net.Socket socket)</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../processing/net/Client.html#Client(processing.core.PApplet, java.lang.String, int)">Client</A></B>(<A HREF="../../processing/core/PApplet.html" title="class in processing.core">PApplet</A> parent, java.lang.String host, int port)</CODE> <BR> </TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../processing/net/Client.html#active()">active</A></B>()</CODE> <BR> Return true if this client is still active and hasn't run into any trouble.</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="../../processing/net/Client.html#available()">available</A></B>()</CODE> <BR> Returns the number of bytes that have been read from serial and are waiting to be dealt with by the user.</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="../../processing/net/Client.html#clear()">clear</A></B>()</CODE> <BR> Ignore all the bytes read so far and empty the buffer.</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="../../processing/net/Client.html#dispose()">dispose</A></B>()</CODE> <BR> Disconnect from the server: internal use only.</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="../../processing/net/Client.html#ip()">ip</A></B>()</CODE> <BR> Returns the ip address of this feller as a String.</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="../../processing/net/Client.html#read()">read</A></B>()</CODE> <BR> Returns a number between 0 and 255 for the next byte that's waiting in the buffer.</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="../../processing/net/Client.html#readBytes()">readBytes</A></B>()</CODE> <BR> Return a byte array of anything that's in the serial buffer.</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="../../processing/net/Client.html#readBytes(byte[])">readBytes</A></B>(byte[] outgoing)</CODE> <BR> Grab whatever is in the serial buffer, and stuff it into a byte buffer passed in by the user.</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="../../processing/net/Client.html#readBytesUntil(int)">readBytesUntil</A></B>(int interesting)</CODE> <BR> Reads from the serial port into a buffer of bytes up to and including a particular character.</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="../../processing/net/Client.html#readBytesUntil(int, byte[])">readBytesUntil</A></B>(int interesting, byte[] outgoing)</CODE> <BR> Reads from the serial port into a buffer of bytes until a particular character.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> char</CODE></FONT></TD> <TD><CODE><B><A HREF="../../processing/net/Client.html#readChar()">readChar</A></B>()</CODE> <BR> Returns the next byte in the buffer as a char.</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="../../processing/net/Client.html#readString()">readString</A></B>()</CODE> <BR> Return whatever has been read from the serial port so far as a String.</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="../../processing/net/Client.html#readStringUntil(int)">readStringUntil</A></B>(int interesting)</CODE> <BR> Combination of readBytesUntil and readString.</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="../../processing/net/Client.html#run()">run</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="../../processing/net/Client.html#stop()">stop</A></B>()</CODE> <BR> Disconnect from the server and calls disconnectEvent(Client c) in the host PApplet.</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="../../processing/net/Client.html#write(byte[])">write</A></B>(byte[] bytes)</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="../../processing/net/Client.html#write(int)">write</A></B>(int what)</CODE> <BR> This will handle ints, bytes and chars transparently.</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="../../processing/net/Client.html#write(java.lang.String)">write</A></B>(java.lang.String what)</CODE> <BR> Write a String to the output.</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"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, getClass, hashCode, notify, notifyAll, toString, 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"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="input"><!-- --></A><H3> input</H3> <PRE> public java.io.InputStream <B>input</B></PRE> <DL> <DL> </DL> </DL> <HR> <A NAME="output"><!-- --></A><H3> output</H3> <PRE> public java.io.OutputStream <B>output</B></PRE> <DL> <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"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="Client(processing.core.PApplet, java.lang.String, int)"><!-- --></A><H3> Client</H3> <PRE> public <B>Client</B>(<A HREF="../../processing/core/PApplet.html" title="class in processing.core">PApplet</A> parent, java.lang.String host, int port)</PRE> <DL> </DL> <HR> <A NAME="Client(processing.core.PApplet, java.net.Socket)"><!-- --></A><H3> Client</H3> <PRE> public <B>Client</B>(<A HREF="../../processing/core/PApplet.html" title="class in processing.core">PApplet</A> parent, java.net.Socket socket) throws java.io.IOException</PRE> <DL> <DL> <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE></DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="stop()"><!-- --></A><H3> stop</H3> <PRE> public void <B>stop</B>()</PRE> <DL> <DD>Disconnect from the server and calls disconnectEvent(Client c) in the host PApplet. <P/> Use this to shut the connection if you're finished with it while your applet is still running. Otherwise, it will be automatically be shut down by the host PApplet (using dispose, which is identical) <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="dispose()"><!-- --></A><H3> dispose</H3> <PRE> public void <B>dispose</B>()</PRE> <DL> <DD>Disconnect from the server: internal use only. <P> This should only be called by the internal functions in PApplet, use stop() instead from within your own applets. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="run()"><!-- --></A><H3> run</H3> <PRE> public void <B>run</B>()</PRE> <DL> <DD><DL> <DT><B>Specified by:</B><DD><CODE>run</CODE> in interface <CODE>java.lang.Runnable</CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="active()"><!-- --></A><H3> active</H3> <PRE> public boolean <B>active</B>()</PRE> <DL> <DD>Return true if this client is still active and hasn't run into any trouble. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="ip()"><!-- --></A><H3> ip</H3> <PRE> public java.lang.String <B>ip</B>()</PRE> <DL> <DD>Returns the ip address of this feller as a String. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="available()"><!-- --></A><H3> available</H3> <PRE> public int <B>available</B>()</PRE> <DL> <DD>Returns the number of bytes that have been read from serial and are waiting to be dealt with by the user. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="clear()"><!-- --></A><H3> clear</H3> <PRE> public void <B>clear</B>()</PRE> <DL> <DD>Ignore all the bytes read so far and empty the buffer. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="read()"><!-- --></A><H3> read</H3> <PRE> public int <B>read</B>()</PRE> <DL> <DD>Returns a number between 0 and 255 for the next byte that's waiting in the buffer. Returns -1 if there was no byte (although the user should first check available() to see if things are ready to avoid this) <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readChar()"><!-- --></A><H3> readChar</H3> <PRE> public char <B>readChar</B>()</PRE> <DL> <DD>Returns the next byte in the buffer as a char. Returns -1, or 0xffff, if nothing is there. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readBytes()"><!-- --></A><H3> readBytes</H3> <PRE> public byte[] <B>readBytes</B>()</PRE> <DL> <DD>Return a byte array of anything that's in the serial buffer. Not particularly memory/speed efficient, because it creates a byte array on each read, but it's easier to use than readBytes(byte b[]) (see below). <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readBytes(byte[])"><!-- --></A><H3> readBytes</H3> <PRE> public int <B>readBytes</B>(byte[] outgoing)</PRE> <DL> <DD>Grab whatever is in the serial buffer, and stuff it into a byte buffer passed in by the user. This is more memory/time efficient than readBytes() returning a byte[] array. Returns an int for how many bytes were read. If more bytes are available than can fit into the byte array, only those that will fit are read. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readBytesUntil(int)"><!-- --></A><H3> readBytesUntil</H3> <PRE> public byte[] <B>readBytesUntil</B>(int interesting)</PRE> <DL> <DD>Reads from the serial port into a buffer of bytes up to and including a particular character. If the character isn't in the serial buffer, then 'null' is returned. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readBytesUntil(int, byte[])"><!-- --></A><H3> readBytesUntil</H3> <PRE> public int <B>readBytesUntil</B>(int interesting, byte[] outgoing)</PRE> <DL> <DD>Reads from the serial port into a buffer of bytes until a particular character. If the character isn't in the serial buffer, then 'null' is returned. If outgoing[] is not big enough, then -1 is returned, and an error message is printed on the console. If nothing is in the buffer, zero is returned. If 'interesting' byte is not in the buffer, then 0 is returned. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readString()"><!-- --></A><H3> readString</H3> <PRE> public java.lang.String <B>readString</B>()</PRE> <DL> <DD>Return whatever has been read from the serial port so far as a String. It assumes that the incoming characters are ASCII. If you want to move Unicode data, you can first convert the String to a byte stream in the representation of your choice (i.e. UTF8 or two-byte Unicode data), and send it as a byte array. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="readStringUntil(int)"><!-- --></A><H3> readStringUntil</H3> <PRE> public java.lang.String <B>readStringUntil</B>(int interesting)</PRE> <DL> <DD>Combination of readBytesUntil and readString. See caveats in each function. Returns null if it still hasn't found what you're looking for. <p/> If you want to move Unicode data, you can first convert the String to a byte stream in the representation of your choice (i.e. UTF8 or two-byte Unicode data), and send it as a byte array. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="write(int)"><!-- --></A><H3> write</H3> <PRE> public void <B>write</B>(int what)</PRE> <DL> <DD>This will handle ints, bytes and chars transparently. <P> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="write(byte[])"><!-- --></A><H3> write</H3> <PRE> public void <B>write</B>(byte[] bytes)</PRE> <DL> <DD><DL> </DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="write(java.lang.String)"><!-- --></A><H3> write</H3> <PRE> public void <B>write</B>(java.lang.String what)</PRE> <DL> <DD>Write a String to the output. Note that this doesn't account for Unicode (two bytes per char), nor will it send UTF8 characters.. It assumes that you mean to send a byte buffer (most often the case for networking and serial i/o) and will only use the bottom 8 bits of each char in the string. (Meaning that internally it uses String.getBytes) If you want to move Unicode data, you can first convert the String to a byte stream in the representation of your choice (i.e. UTF8 or two-byte Unicode data), and send it as a byte array. <P> <DD><DL> </DL> </DD> <DD><DL> </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=2 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="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> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../processing/net/Server.html" title="class in processing.net"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?processing/net/Client.html" target="_top"><B>FRAMES</B></A> <A HREF="Client.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>