想不出来Encoder/Decoder中GetBytes/GetChars函数参数的最后一个那个bool flush是用来干嘛的,谁能写个当他=true和当他=false的对比例子让我看看吗?public virtual int GetChars (
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
bool flush
)
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
bool flush
)
解决方案 »
- 求截取价格正则表达式
- DataGridView Rows.Insert 插入DataGridViewRow对象到首行 Row对象 被偷换的 问题。。。。加分。。。
- c#是否可以封装成标准的win32 dll?
- 配置了环境变量,csc还是不能用
- 可执行程序的集成问题
- .net下一个类的实例在内存里的具体存在形式和调用原理是什么?
- 求SourceSafe8.0,急等!!高分!!
- startindex 不能小于 0
- c# winform下如何实下局域网文件的上传下载功能
- 怎样在datagrid控件里对某字段,根据不同条件显示出不同图标
- 求助大虾,vs2005下,改项目里文件名称空间的问题,谢谢帮助 ^_^
- dataGridView如何显示DS中部分字段
ms-help://MS.MSDNQTR.v80.chs/MS.MSDN.v80/MS.NETDEVFX.v20.chs/cpref23/html/M_System_Text_Decoder_GetChars_2_00cfdfac.htm
程序集:mscorlib(在 mscorlib.dll 中)语法
Visual Basic(声明)
Public Overridable Function GetChars ( _
bytes As Byte(), _
byteIndex As Integer, _
byteCount As Integer, _
chars As Char(), _
charIndex As Integer, _
flush As Boolean _
) As Integer
Visual Basic(用法)
Dim instance As Decoder
Dim bytes As Byte()
Dim byteIndex As Integer
Dim byteCount As Integer
Dim chars As Char()
Dim charIndex As Integer
Dim flush As Boolean
Dim returnValue As IntegerreturnValue = instance.GetChars(bytes, byteIndex, byteCount, chars, charIndex, flush)
C#
public virtual int GetChars (
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
bool flush
)
C++
public:
virtual int GetChars (
array<unsigned char>^ bytes,
int byteIndex,
int byteCount,
array<wchar_t>^ chars,
int charIndex,
bool flush
)
J#
public int GetChars (
byte[] bytes,
int byteIndex,
int byteCount,
char[] chars,
int charIndex,
boolean flush
)
JScript
public function GetChars (
bytes : byte[],
byteIndex : int,
byteCount : int,
chars : char[],
charIndex : int,
flush : boolean
) : int
参数
bytes
包含要解码的字节序列的字节数组。 byteIndex
第一个要解码的字节的索引。 byteCount
要解码的字节数。 chars
要用于包含所产生的字符集的字符数组。 charIndex
开始写入所产生的字符集的索引位置。 flush
如果要在转换后清除解码器的内部状态,则为 true;否则,为 false。 返回值
写入 chars 参数的实际字符数。
备注
若要计算 GetChars 存储结果字符所需的精确数组大小,请使用 GetCharCount。如果在将 flush 设置为 false 的情况下调用 GetChars,则位于数据块结尾的尾随字节将存储在内部缓冲区中,并在下一次解码操作中使用。对一个数据块调用 GetCharCount 后,紧接着对同一块调用 GetChars,以便在计算中包括前一个块的所有尾随字节。如果调用 GetChars,并将 flush 设置为 true,则忽略数据块末尾的无效字节并清除内部缓冲区。此方法影响解码器的状态。