111,129
社区成员
发帖
与我相关
我的任务
分享
private byte[] GetUTF8ByteArray(byte[] src)
{
UTF8Encoding encoding = new UTF8Encoding();
string utf8String = encoding.GetString(src, 0, src.Length);
utf8String = utf8String.Replace("\r", string.Empty).Replace("\n", string.Empty);
return encoding.GetBytes(utf8String);
}
ZipInputStream s = null;
ZipEntry theEntry = null;
StringBuilder strBld = new StringBuilder();
try
{
s = new ZipInputStream(streamfile);
while ((theEntry = s.GetNextEntry()) != null)
{
if (Path.GetFileName(theEntry.Name) != String.Empty)
{
int size = 10048576;
byte[] data = new byte[10048576];
while (true)
{
size = s.Read(data, 0, data.Length);
if (size > 0)
{
strBld.Append(Encoding.Default.GetString(data, 0, size));
}
else
{
break;
}
}
}
}
}
int size = 10048576;
byte[] data = new byte[10048576];
while (true)
{
size = s.Read(data, 0, data.Length);
if (size > 0)
{
strBld.Append(Encoding.Default.GetString(data, 0, size));
}
else
{
break;
}
}