BN089-BS开发框架MVC4版/source20131023/Zephyr.Net/Zephyr.Utils/Document/Excel/ExcelLibrary/CodeLib/StreamHelper.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace QiHe.CodeLib
{
/// <summary>
/// This class represents a Stream Helper.
/// </summary>
public class StreamHelper
{
/// <summary>
/// Write Byte Order Mark(BOM) of streamWriter's Encoding
/// to streamWriter's underlying stream.
/// </summary>
/// <param name="streamWriter">The stream writer.</param>
public static void WriteByteOrderMark(StreamWriter streamWriter)
{
byte[] BOM = streamWriter.Encoding.GetPreamble();
streamWriter.BaseStream.Write(BOM, 0, BOM.Length);
}
/// <summary>
/// Writes the bytes.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="bytes">The bytes.</param>
public static void WriteBytes(Stream stream, byte[] bytes)
{
stream.Write(bytes, 0, bytes.Length);
}
/// <summary>
/// Reads the bytes.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="count">The count.</param>
/// <returns></returns>
public static byte[] ReadBytes(Stream stream, int count)
{
int length = Math.Min((int)stream.Length, count);
byte[] bytes = new byte[length];
stream.Read(bytes, 0, bytes.Length);
return bytes;
}
/// <summary>
/// Reads the bytes.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="buffer">The buffer.</param>
public static void ReadBytes(Stream stream, byte[] buffer)
{
stream.Read(buffer, 0, buffer.Length);
}
/// <summary>
/// Reads to end.
/// </summary>
后面还有 62 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
