📄 javax.comm.commport.html
字号:
public abstract OutputStream getOutputStream() throws IOException
</pre>
<dl>
<dd> Returns an output stream. This is the only way to send data to the communications port. If the port is unidirectional and doesn't support sending data, then <CODE>getOutputStream</CODE> returns null.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> OutputStream object that can be used to write to the port
<dt> <b>Throws:</b> IOException
<dd> if an I/O error occurred
</dl></dd>
</dl>
<a name="close()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="close"><b>close</b></a>
<pre>
public void close()
</pre>
<dl>
<dd> Closes the communications port. The application must call <CODE>close</CODE> when it is done with the port. Notification of this ownership change will be propagated to all classes registered using <CODE>addPortOwnershipListener</CODE>.
<p>
</dl>
<a name="enableReceiveThreshold(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="enableReceiveThreshold"><b>enableReceiveThreshold</b></a>
<pre>
public abstract void enableReceiveThreshold(int thresh) throws <a href="javax.comm.UnsupportedCommOperationException.html#_top_">UnsupportedCommOperationException</a>
</pre>
<dl>
<dd> Enables receive threshold, if this feature is supported by the driver. When the receive threshold condition becomes true, a <CODE>read</CODE> from the input stream for this port will return immediately. <P> <CODE>enableReceiveThreshold</CODE> is an advisory method which the driver may not implement. By default, receive threshold is not enabled. <P> An application can determine whether the driver supports this feature by first calling the <CODE>enableReceiveThreshold</CODE> method and then calling the <CODE>isReceiveThresholdEnabled</CODE> method. If <CODE>isReceiveThresholdEnabled</CODE> still returns false, then receive threshold is not supported by the driver. If the driver does not implement this feature, it will return from blocking reads at an appropriate time.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> thresh - when this many bytes are in the input buffer, return immediately from <CODE>read</CODE>.<P>
<dt> <b>Throws:</b> <a href="javax.comm.UnsupportedCommOperationException.html#_top_">UnsupportedCommOperationException</a>
<dd> is thrown if receive threshold is not supported by the underline driver.
</dl></dd>
</dl>
<a name="disableReceiveThreshold()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="disableReceiveThreshold"><b>disableReceiveThreshold</b></a>
<pre>
public abstract void disableReceiveThreshold()
</pre>
<dl>
<dd> Disables receive threshold.
<p>
</dl>
<a name="isReceiveThresholdEnabled()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isReceiveThresholdEnabled"><b>isReceiveThresholdEnabled</b></a>
<pre>
public abstract boolean isReceiveThresholdEnabled()
</pre>
<dl>
<dd> Checks if receive threshold is enabled.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> boolean true if the driver supports receive threshold.
</dl></dd>
</dl>
<a name="getReceiveThreshold()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getReceiveThreshold"><b>getReceiveThreshold</b></a>
<pre>
public abstract int getReceiveThreshold()
</pre>
<dl>
<dd> Gets the integer value of the receive threshold. If the receive threshold is disabled or not supported by the driver, then the value returned is meaningless.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> number of bytes for receive threshold
</dl></dd>
</dl>
<a name="enableReceiveTimeout(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="enableReceiveTimeout"><b>enableReceiveTimeout</b></a>
<pre>
public abstract void enableReceiveTimeout(int rcvTimeout) throws <a href="javax.comm.UnsupportedCommOperationException.html#_top_">UnsupportedCommOperationException</a>
</pre>
<dl>
<dd> Enables receive timeout, if this feature is supported by the driver. When the receive timeout condition becomes true, a <CODE>read</CODE> from the input stream for this port will return immediately. <P> <CODE>enableReceiveTimeout</CODE> is an advisory method which the driver may not implement. By default, receive timeout is not enabled. <P> An application can determine whether the driver supports this feature by first calling the <CODE>enableReceiveTimeout</CODE> method and then calling the <CODE>isReceiveTimeout</CODE> method. If <CODE>isReceiveTimeout</CODE> still returns false, then receive timeout is not supported by the driver.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> rcvTimeout - when this many milliseconds have elapsed, return immediately from <CODE>read</CODE>, regardless of bytes in input buffer. <P>
<dt> <b>Throws:</b> <a href="javax.comm.UnsupportedCommOperationException.html#_top_">UnsupportedCommOperationException</a>
<dd> is thrown if receive timeout is not supported by the underline driver.
</dl></dd>
</dl>
<a name="disableReceiveTimeout()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="disableReceiveTimeout"><b>disableReceiveTimeout</b></a>
<pre>
public abstract void disableReceiveTimeout()
</pre>
<dl>
<dd> Disables receive timeout.
<p>
</dl>
<a name="isReceiveTimeoutEnabled()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isReceiveTimeoutEnabled"><b>isReceiveTimeoutEnabled</b></a>
<pre>
public abstract boolean isReceiveTimeoutEnabled()
</pre>
<dl>
<dd> Checks if receive timeout is enabled.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> boolean true if the driver supports receive timeout.
</dl></dd>
</dl>
<a name="getReceiveTimeout()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getReceiveTimeout"><b>getReceiveTimeout</b></a>
<pre>
public abstract int getReceiveTimeout()
</pre>
<dl>
<dd> Gets the integer value of the receive timeout. If the receive timeout is disabled or not supported by the driver, then the value returned is meaningless.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> number of milliseconds in receive timeout
</dl></dd>
</dl>
<a name="enableReceiveFraming(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="enableReceiveFraming"><b>enableReceiveFraming</b></a>
<pre>
public abstract void enableReceiveFraming(int framingByte) throws <a href="javax.comm.UnsupportedCommOperationException.html#_top_">UnsupportedCommOperationException</a>
</pre>
<dl>
<dd> Enables receive framing, if this feature is supported by the driver. When the receive framing condition becomes true, a <CODE>read</CODE> from the input stream for this port will return immediately. <P> <CODE>enableReceiveFraming</CODE> is an advisory method which the driver may not implement. By default, receive framing is not enabled. <P> An application can determine whether the driver supports this feature by first calling the <CODE>enableReceiveFraming</CODE> method and then calling the <CODE>isReceiveFramingEnabled</CODE> method. If <CODE>isReceiveFramingEnabled</CODE> still returns false, then receive framing is not supported by the driver.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> framingByte - this byte in the input stream suggests the end of the received frame. Blocked reads will return immediately. Only the low 8 bits of <CODE>framingByte</CODE> are used while the upper 24 bits are masked off. A value outside the range of 0-255 will be converted to the value of its lowest 8 bits. <P>
<dt> <b>Throws:</b> <a href="javax.comm.UnsupportedCommOperationException.html#_top_">UnsupportedCommOperationException</a>
<dd> is thrown if receive timeout is not supported by the underline driver.
</dl></dd>
</dl>
<a name="disableReceiveFraming()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="disableReceiveFraming"><b>disableReceiveFraming</b></a>
<pre>
public abstract void disableReceiveFraming()
</pre>
<dl>
<dd> Disables receive framing.
<p>
</dl>
<a name="isReceiveFramingEnabled()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="isReceiveFramingEnabled"><b>isReceiveFramingEnabled</b></a>
<pre>
public abstract boolean isReceiveFramingEnabled()
</pre>
<dl>
<dd> Checks if receive framing is enabled.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> boolean true if the driver supports receive framing.
</dl></dd>
</dl>
<a name="getReceiveFramingByte()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getReceiveFramingByte"><b>getReceiveFramingByte</b></a>
<pre>
public abstract int getReceiveFramingByte()
</pre>
<dl>
<dd> Gets the current byte used for receive framing. If the receive framing is disabled or not supported by the driver, then the value returned is meaningless. The return value of <CODE>getReceiveFramingByte</CODE> is an integer, the low 8 bits of which represent the current byte used for receive framing.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> integer current byte used for receive framing
</dl></dd>
</dl>
<a name="setInputBufferSize(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setInputBufferSize"><b>setInputBufferSize</b></a>
<pre>
public abstract void setInputBufferSize(int size)
</pre>
<dl>
<dd> Sets the input buffer size. Note that this is advisory and memory availability may determine the ultimate buffer size used by the driver.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> size - size of the input buffer
</dl></dd>
</dl>
<a name="getInputBufferSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInputBufferSize"><b>getInputBufferSize</b></a>
<pre>
public abstract int getInputBufferSize()
</pre>
<dl>
<dd> Gets the input buffer size. Note that this method is advisory and the underlying OS may choose not to report correct values for the buffer size.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> input buffer size currently in use
</dl></dd>
</dl>
<a name="setOutputBufferSize(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setOutputBufferSize"><b>setOutputBufferSize</b></a>
<pre>
public abstract void setOutputBufferSize(int size)
</pre>
<dl>
<dd> Sets the output buffer size. Note that this is advisory and memory availability may determine the ultimate buffer size used by the driver.
<p>
<dd><dl>
<dt> <b>Parameters:</b>
<dd> size - size of the output buffer
</dl></dd>
</dl>
<a name="getOutputBufferSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getOutputBufferSize"><b>getOutputBufferSize</b></a>
<pre>
public abstract int getOutputBufferSize()
</pre>
<dl>
<dd> Gets the output buffer size. Note that this method is advisory and the underlying OS may choose not to report correct values for the buffer size.
<p>
<dd><dl>
<dt> <b>Returns:</b>
<dd> output buffer size currently in use
</dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-javax.comm.html">This Package</a> <a href="Package-javax.comm.html">Previous</a> <a href="javax.comm.CommPortIdentifier.html#_top_">Next</a> <a href="AllNames.html">Index</a></pre>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -