return _encoding.GetString(Bytes, 0, Pos1);
}
}
public string String2 {
get {
if (Pos1 == -1) return null;
return _encoding.GetString(Bytes, Pos1 + 1, Size - Pos1 - 1 -2);
}
}
public string FullString
{
get {
if(Size < 1) return null;
return _encoding.GetString(Bytes, 0, Size-2);
}
}
}
BytesNode,乎窃燕幣忖准方怏全燕嶄議匯倖准泣?凪嶄Next奉來峺?全燕嶄議和匯倖准泣?凪噫議脅 頁匯倖逸廁來議圭隈才奉來?曳泌乎准泣厮将盾裂欺焚担了崔阻?嗤丼忖准議潤崩葎峭?式泌採委徭失俳 撹曾倖?資函嗤丼忖准方怏?委嗤丼忖准方怏盾裂撹忖憲堪吉圭隈。乎窃勝楚恂撹音延窃?撹埀嬬喘 readonly祥喘readonly?宸劔辛參壓謹?殻議扮昨契峭紗迄。
public class BytesNode{
private readonly byte[] _bytes;
public BytesNode Next;
int _start;
int _end;
public BytesNode(byte[] bs) {
_bytes = bs;
_start = 0;
_end = bs.Length;
}
private BytesNode(byte[] bs, int start, int end) {
_bytes = bs;
_start = start;
_end = end;
}
public BytesNode CutNew(BytesNode preNode, int start, int end) {
BytesNode tempNode = new BytesNode(_bytes, start, end);
if(preNode != null)preNode.Next = tempNode;
tempNode.Next = Next;
return tempNode;
}
public void Cut(int start, int end) {
_start = start;
_end = end;
}
public int Start {
get { return _start; }
}
public int End {
get { return _end; }
}
public int Length {
get { return _end - _start; }
}
public byte[] Value {
get { return _bytes; }
}
public byte[] Bytes {
get {
List<byte> ret = new List<byte>();
BytesNode tempNode = this;
byte[] tempBs;
while (tempNode != null) {
tempBs = new byte[tempNode.Length];
Buffer.BlockCopy(tempNode.Value, tempNode.Start, tempBs, 0, tempNode.Length);
ret.AddRange(tempBs);
tempNode = tempNode.Next;
}
return ret.ToArray();
}
}
public string GetString()
{
return GetString(Encoding.UTF8);
}
public string GetStrin
|