このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。

翻訳前ページへ


Interface XInputStream
Language

The 解放する/自由な and Open 生産性 控訴
解放(する)d: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: 星/主役にする :: io ::

interface XInputStream
Description
This is the basic interface to read data from a stream.

See the streaming 文書 for その上の (警察などへの)密告,告訴(状) on chaining and 麻薬を吸うing streams.


Methods' 要約
readBytes reads the 明示するd number of bytes in the given sequence.  
readSomeBytes reads the 利用できる number of bytes, at 最大限 nMaxBytesToRead.  
skipBytes skips the next nBytesToSkip bytes (must be 肯定的な).  
利用できる 明言する/公表するs how many bytes can be read or skipped without 封鎖するing.  
closeInput の近くにs the stream.  
Methods' 詳細(に述べる)s
readBytes
long
readBytes( [out] sequence< byte >  aData,
[in] long  nBytesToRead )
raises( NotConnectedException,
BufferSizeExceededException,
IOException );

Description
reads the 明示するd number of bytes in the given sequence.

The return value 明示するs the number of bytes which have been put into the sequence. A difference between nBytesToRead and the return value 示すs that EOF has been reached. This means that the method 封鎖するs until the 明示するd number of bytes are 利用できる or the EOF is reached.

Parameter aData
after the call, the byte sequence 含む/封じ込めるs the requested number of bytes (or いっそう少なく as a 調印する of EOF).

C++ only : 公式文書,認める that for unbridged (e.g., in-過程) calls, using the same sequence for repetive readBytes()-calls can 耐える a 業績/成果 advantage. The callee can put the data 直接/まっすぐに into the sequence so that no 衝撃を和らげるもの reallocation is necessary. But this 持つ/拘留するs only when

  1. neither 報知係 nor callee keep a second 言及/関連 to the same sequence.
  2. the sequence is pre-配分するd with the requested number of bytes.
  3. the same sequence is 再使用するd ( 簡単に preallocationg a new sequence for every call 耐えるs no advantage ).
  4. the call is not 橋(渡しをする)d (e.g., betweeen different compilers or different 過程s ).
If the same 'optimized' code runs against an interface in a different 過程, there is an unnecessary memory 配分/deallocation (the out parameter is of course NOT 輸送(する)d over the 関係), but this should be ごくわずかの compared to a synchron call.
Parameter nBytesToRead
the total number of bytes to read
readSomeBytes
long
readSomeBytes( [out] sequence< byte >  aData,
[in] long  nMaxBytesToRead )
raises( NotConnectedException,
BufferSizeExceededException,
IOException );

Description
reads the 利用できる number of bytes, at 最大限 nMaxBytesToRead.

This method is very 類似の to the readBytes method, except that it has different 封鎖するing behaviour. The method 封鎖するs as long as at least 1 byte is 利用できる or EOF has been reached. EOF has only been reached, when the method returns 0 and the corresponding byte sequence is empty. さもなければ, after the call, aData 含む/封じ込めるs the 利用できる, but no more than nMaxBytesToRead, bytes.

Parameter aData
含む/封じ込めるs the data read from the stream.
Parameter nMaxBytesToRead
The 最大限 number of bytes to be read from this stream during the call.
See also
XInputStream::readBytes
skipBytes
無効の
skipBytes( [in] long  nBytesToSkip )
raises( NotConnectedException,
BufferSizeExceededException,
IOException );

Description
skips the next nBytesToSkip bytes (must be 肯定的な).

It is up to the 実施 whether this method is 封鎖するing the thread or not.

Parameter nBytesToSkip
number of bytes to skip
利用できる
long
利用できる()
raises( NotConnectedException,
IOException );

Description
明言する/公表するs how many bytes can be read or skipped without 封鎖するing.

公式文書,認める: This method 申し込む/申し出s no (警察などへの)密告,告訴(状) on whether the EOF has been reached.

closeInput
無効の
closeInput()
raises( NotConnectedException,
IOException );

Description
の近くにs the stream.

使用者s must の近くに the stream explicitly when no その上の reading should be done. (There may 存在する (犯罪の)一味 言及/関連s to chained 反対するs that can only be 解放(する)d during this call. Thus not calling this method would result in a 漏れる of memory or 外部の 資源s.)

最高の,を越す of Page

Apache Software Foundation

Copyright & License | Privacy | 接触する Us | 寄付する | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are 登録(する)d trademarks of The Apache ソフトウェア 創立/基礎. The Apache feather logo is a trademark of The Apache ソフトウェア 創立/基礎. Other 指名するs appearing on the 場所/位置 may be trademarks of their 各々の owners.