}
public override bool CanWrite
{
get { return true; }
}
public override long Length
{
get { return 0; }
}
public override long Position
{
get { return _position; }
set { _position = value; }
}
public override long Seek(long offset, System.IO.SeekOrigin direction)
{
return _sink.Seek(offset, direction);
}
public override void SetLength(long length)
{
_sink.SetLength(length);
}
public override void Close()
{
_sink.Close();
}
public override void Flush()
{
_sink.Flush();
}
public override int Read(byte[] buffer, int offset, int count)
{
return _sink.Read(buffer, offset, count);
}
//GB2312 936
//Big5 950
public override void Write(byte[] buffer, int offset, int count)
{
Encoding e=Encoding.GetEncoding(936);
string str=e.GetString(buffer,offset,count);
for(int i=0;i<str.Length;i )
{
int j=_sGB.IndexOf(str[i]);
if(j!=-1)str=str.Replace(_sGB[j],_tGB[j]);
}
e=Encoding.GetEncoding(950);
_sink.Write(e.GetBytes(str), 0, e.GetByteCount(str));
}
}
(End)
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




