⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 course5.htm

📁 JAVA开发手册,查询JAVASDK的函数!
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<p class="title_2">参数</p>
<p>length</p>
<p>缓冲区的字符长度。</p>
<p class="title_2">返回值</p>
<p>返回所读取的字符串值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.readStringCharsAnsi方法。</p>
<p>DataStream.readStringNull</p>
<p>从数据流中读取以null结尾的单一码字符串。</p>
<p class="title_2">语法</p>
<p>public String readStringNull ()。</p>
<p class="title_2">返回值</p>
<p>返回所读取的字符串值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.readStringNull方法。</p>
<p>DataStream.readStringNullAnsi</p>
<p>从数据流中读取以null结尾的ANSI字符串。</p>
<p class="title_2">语法</p>
<p>public String readStringNullAnsi()。</p>
<p class="title_2">返回值</p>
<p>返回所读取的字符串值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.readStringNullAnsi方法。</p>
<p>DataStream.readToEnd</p>
<p>读取从当前位置开始直到数据流的末尾的数据。</p>
<p class="title_2">语法</p>
<p>public byte[] readToEnd()。</p>
<p class="title_2">返回值</p>
<p>返回一个字节矩阵,包含了所读取的数据。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.readToEnd方法。</p>
<p>DataStream.readUTF</p>
<p>使用预定长UTF-8格式从数据流中读取字符串。</p>
<p class="title_2">语法</p>
<p>public String readUTF()。</p>
<p class="title_2">返回值</p>
<p>返回一个字节矩阵,包含了所读取的数据。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.readUTF方法。</p>
<p>DataStream.setLength</p>
<p>数值数据流的长度。</p>
<p class="title_2">语法</p>
<p>public void setLength(long length)</p>
<p class="title_2">参数</p>
<p>length新的数据流长度。</p>
<p>DataStream.readUTF</p>
<p>使用预定长UTF-8格式从数据流中读取字符串。</p>
<p class="title_2">语法</p>
<p>public String readUTF()。</p>
<p class="title_2">返回值</p>
<p>返回一个字节矩阵,包含了所读取的数据。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.readUTF方法。</p>
<p>DataStream.setLength</p>
<p>数值数据流的长度。</p>
<p class="title_2">语法</p>
<p>public void setLength(long length)</p>
<p class="title_2">参数</p>
<p>length</p>
<p>新的数据流长度。</p>
<p class="title_2">说明</p>
<p>该方法实现了IByteStream.setLength方法。这个缺省实现将产生IOException,你可以在子类中覆盖该方法以提供正确的功能。DataStream.setPosition数值数据流的位置。</p>
<p class="title_2">语法</p>
<p>public void setPosition( long position )</p>
<p class="title_2">参数</p>
<p>position数据流新的位置。</p>
<p class="title_2">说明</p>
<p>该方法实现了IByteStream.setPosition方法。这个缺省实现将产生IOException,你可以在子类中覆盖该方法以提供正确的功能。</p>
<p class="title_2">返回值</p>
<p>返回数据流当前的位置。</p>
<p>DataStream.toComStream</p>
<p>检取IDataStream对象的IStream对象。</p>
<p class="title_2">语法</p>
<p>pubilc static IStream toComStream ( IDataStream dataStream )</p>
<p class="title_2">参数</p>
<p>dataStream</p>
<p>创建IStream对象所需要的IDataStream对象。</p>
<p class="title_2">返回值</p>
<p>为指定的IDataStream对象返回一个com.ms.com.IStream对象。</p>
<p class="title_2">说明</p>
<p>如果有一个IDataStream对象而需要一个与COM兼容的IStream对象,就可以使用该方法创建一个适配器。如果指定的IDataStream对象是null,该方法将返回null。否则,就调用getComStream方法从IDataStream对象中创建一个IStream对象。</p>
<p>请参阅:fromComStream, getComStream</p>
<p>DataStream.write</p>
<p>将数据写入数据流。</p>
<p class="title_2">语法</p>
<p>public void write( int value )</p>
<p>public void write( byte[] buffer, int index, int count )</p>
<p class="title_2">参数</p>
<p>value</p>
<p>要写入的值。</p>
<p>buffer</p>
<p>包含要写入数据的矩阵。</p>
<p>index</p>
<p>缓冲区起始位置的索引。</p>
<p>count</p>
<p>要写入的字节数。</p>
<p class="title_2">说明</p>
<p>该方法实现了IByteStream.write方法。第一个方法将向数据流中写入下一个字节。第二个方法先验证参数是否有效,然后再调用writeCore方法写入数据。</p>
<p>DataStream.writeBoolean</p>
<p>向数据流中写入boolean值。</p>
<p class="title_2">语法</p>
<p>public void writeBoolean (boolean value)</p>
<p class="title_2">参数</p>
<p>value</p>
<p>要写入的值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeBoolean方法。该方法调用write方法向数据流中写入一个字节,false就写入0,true就写入1。</p>
<p>DataStream.writeByte</p>
<p>向数据流中写入一个字节。</p>
<p class="title_2">语法</p>
<p>public void writeByte(byte value)</p>
<p class="title_2">参数</p>
<p>value要写入的值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeByte方法。该方法调用write方法向数据流中写入字节。DataStream.writeBytes向数据流中写入一字节块。</p>
<p class="title_2">语法</p>
<p>public void writeBytes ( byte[] buffer )</p>
<p class="title_2">参数</p>
<p>buffer</p>
<p>要写入的缓冲区块。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeBytes方法。该方法调用write方法写入字节。</p>
<p>DataStream.writeChar</p>
<p>向数据流中写入一个字符。</p>
<p class="title_2">语法</p>
<p>public void writeChar( char value )</p>
<p class="title_2">参数</p>
<p>value要写入的值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeChar方法。该方法调用write方法将两个字节写入数据流中。DataStream.writeChars将指定的字符矩阵内容写入数据流中。</p>
<p class="title_2">语法</p>
<p>public void writeChars(char[] buffer )</p>
<p>public void writeChars( char[] buffer, int index , int count )</p>
<p class="title_2">参数</p>
<p>buffer</p>
<p>包含要写入数据的矩阵。</p>
<p>index</p>
<p>矩阵中起始位置的索引。</p>
<p>count</p>
<p>要写入的字节数。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeChars方法。该方法先验证参数是否有效,然后调用writeCore方法来写入数据。</p>
<p>DataStream.writeCore</p>
<p>实现核心矩阵写入方法。</p>
<p class="title_2">语法</p>
<p>protected void writeCore ( Object buffer, int offset, int count )</p>
<p class="title_2">参数</p>
<p>buffer</p>
<p>要写入的原子类型矩阵。</p>
<p>offsetbuffer</p>
<p>偏移量字节数。</p>
<p>count</p>
<p>要写入buffer的字节数。</p>
<p>异常</p>
<p>如果出现错误或者数据流不支持写入操作,就产生IOException异常消息。</p>
<p class="title_2">说明</p>
<p>该方法被类中其他的矩阵写入方法所调用。该方法将count个字节的数据写入buffer中的offset位置处。buffer参数必须保证为byte[], char[],short[], int[], long[],float[]或double[]类型。该方法的起始实现将产生IOException异常消息,但你可以在子类中覆盖该方法以提供正确的功能。</p>
<p>DataStream.writeDouble</p>
<p>向数据流中写入double值。</p>
<p class="title_2">语法</p>
<p>public void readDouble (double value )</p>
<p class="title_2">参数</p>
<p>value要写入的double值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeDouble方法。该方法先将double值转换为长整数值,然后调用writeLong方法将数据写入数据流中。</p>
<p>DataStream.writeDoubles</p>
<p>将指定的double矩阵内容写入数据流中。</p>
<p class="title_2">语法</p>
<p>public void writeDoubles ( double[] buffer)</p>
<p>public void writeDoubles ( double[] buffer, int index, int count )</p>
<p class="title_2">参数</p>
<p>buffer要写入的原子类型矩阵。indexbuffer偏移量字节数。count要写入的双字节数量。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeDoubles方法。该方法先验证</p>
<p class="title_2">参数</p>
<p>是否有效,然后调用writeCore方法来写入数据。</p>
<p>DataStream.writeFloat</p>
<p>向数据流中写入float值。</p>
<p class="title_2">语法public void writeFloat ( float value )</p>
<p class="title_2">参数</p>
<p>value要写入的值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeFloat方法。该方法将float值转换为整数值,然后调用writeInt方法将数值写入数据流中。</p>
<p>DataStream.writeFloats</p>
<p>将指定float矩阵的内容写入数据流中。</p>
<p class="title_2">语法</p>
<p>public void writeFloats ( float[] buffer )</p>
<p>public void writeFloats (float[] buffer, int index, int count )</p>
<p class="title_2">参数</p>
<p>buffer</p>
<p>要写入的原子类型矩阵。</p>
<p>indexbuffer</p>
<p>偏移量字节数。</p>
<p>count</p>
<p>要写入的浮点数数量。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeFloats方法。第一个方法调用writeFloats方法写入数据。第二个方法先验证参数是否有效,然后调用writeCore方法来写入数据。</p>
<p>DataStream.writeInt</p>
<p>向数据流中写入整数值。</p>
<p class="title_2">语法</p>
<p>public void writeInt ( int value )</p>
<p class="title_2">参数</p>
<p>value要写入的数值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeInt方法。该方法调用write方法写入4个字节。</p>
<p>DataStream.writeInts</p>
<p>将指定整数矩阵的内容写入数据流中。</p>
<p class="title_2">语法</p>
<p>public void writeInts ( int[] buffer)</p>
<p>public void writeInts ( int[] buffer, int index, int count )</p>
<p class="title_2">参数</p>
<p>buffer</p>
<p>要写入的原子类型矩阵。</p>
<p>indexbuffer</p>
<p>偏移量字节数。</p>
<p>count</p>
<p>要写入的整数数量。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeInts方法。第一个方法调用writeInts方法写入数据。第二个方法先验证参数是否有效,然后调用writeCore方法来写入数据。</p>
<p>DataStream.writeLong</p>
<p>向数据流中写入long值。</p>
<p class="title_2">语法</p>
<p>public void writeLong ( long value )</p>
<p class="title_2">参数</p>
<p>value要写入的值。</p>
<p class="title_2">说明</p>
<p class="title_2">说明该方法实现了IDataStream.writeLong方法。该方法调用readInt方法两次将long值写入数据流中。</p>
<p>DataStream.writeLongs</p>
<p>将指定长整数矩阵的内容写入数据流中。</p>
<p class="title_2">语法</p>
<p>public void writeLongs ( long[] buffer )</p>
<p>public void writeLongs ( long[] buffer, int index, int count )</p>
<p class="title_2">参数</p>
<p>buffer</p>
<p>要写入的原子类型矩阵。</p>
<p>indexbuffer</p>
<p>偏移量字节数。</p>
<p>count</p>
<p>要写入的长整数的数量。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeLongs方法。第一个方法调用writeLongs方法写入数据。第一个方法先验证参数是否有效,然后调用writeCore方法来写入数据。DataStream.writeShort向数据流中写入short值。</p>
<p class="title_2">语法</p>
<p>public void writeShort ( short value )</p>
<p class="title_2">参数</p>
<p>value要写入的值。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeShort方法。该方法调用write方法两次将两个字节写入数据流。</p>
<p>DataStream.writeShorts</p>
<p>将指定短整数矩阵的内容写入数据流中。</p>
<p class="title_2">语法</p>
<p>public void writeShorts ( short[] buffer )</p>
<p>public void writeShorts ( short[] buffer, int index, int count )</p>
<p class="title_2">参数</p>
<p>buffer要写入的原子类型矩阵。indexbuffer偏移量字节数。count要写入的短整数的数量。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeShorts方法。第一个方法调用writeShorts方法写入数据,第二个方法先验证参数是否有效,然后调用writeCore方法来写入数据。</p>
<p>DataStream.writeString</p>
<p>向数据流中写入预定长度的单一码字符串。</p>
<p class="title_2">语法</p>
<p>public void writeString ( String value )</p>
<p class="title_2">参数</p>
<p>value要写入的字符串。</p>
<p class="title_2">说明</p>
<p class="title_2">说明该方法实现了IDataStream.writeString方法。</p>
<p>DataStream.writeStringChars</p>
<p>向数据流中写入单一码字符串。</p>
<p class="title_2">语法</p>
<p>public void writeStringChars ( String value )</p>
<p class="title_2">参数</p>
<p>value要写入的字符串。</p>
<p class="title_2">说明</p>
<p>该方法实现了IDataStream.writeStringChars方法。</p>
<p>DataStream.writeStringCharsAnsi</p>
<p>向数据流中写入ANSI字符串。</p>
<p class="title_2">语法</p>
<p>public void writeStringCharsAnsi ( String value )</p>
<p class="title_2">参数</p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -