using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
///
/// Summary description for PacketIdentifier
///
namespace Sensor.Gateway.DataXfer
{
public class PacketIdentifier
{
internal int _byteStart;
internal byte[] _bytes;
internal Int32 _downloadId;
internal Int16 _nodeid;
internal Double _downloadTs;
internal Int64 _leftPtr, _rightPtr;
internal Int64 _firstLeftPtr;
public Int64 FirstLeftPtr
{
get { return _firstLeftPtr; }
set { _firstLeftPtr = value; }
}
private List _compressedRecords = new List();
public PacketIdentifier(Int32 downloadId_, string line)
{
try
{
_downloadId = downloadId_;
string[] tokens = line.Split(' ');
_nodeid = Int16.Parse(tokens[0]);
_downloadTs = Double.Parse(tokens[1]);
_leftPtr = Int64.Parse(tokens[2]);
_rightPtr = Int64.Parse(tokens[3]);
_bytes = new byte[tokens.Length - 4];
for (int k = 4; k < tokens.Length; k++)
{
_bytes[k - 4] = byte.Parse(tokens[k]);
}
}
catch (Exception ex)
{
throw ex;
}
}
public byte[] Bytes
{
set { _bytes = value; }
get { return _bytes; }
}
public int ByteStart
{
set { _byteStart = value; }
get { return _byteStart; }
}
public List CompressedRecords
{
set { _compressedRecords = value; }
get { return _compressedRecords; }
}
public Int16 NodeId
{
get { return _nodeid; }
}
}
}