public static PackageData[] GetArrayPackage(string text, int chunkSize) { string[] listStr = Split(text, chunkSize); PackageData[] NewArrayPacket = new PackageData[listStr.Length]; for (int i = 0; i < listStr.Length; i++) { string hashMD5 = ComputeMD5Hash(listStr[i]); NewArrayPacket[i] = new PackageData(i, listStr[i], hashMD5); } return(NewArrayPacket); }
public static PackageData FromBytes(byte[] buffer) { PackageData retVal = new PackageData(); using (MemoryStream ms = new MemoryStream(buffer)) { BinaryReader br = new BinaryReader(ms); retVal.NUMBER = br.ReadInt32(); retVal.DATA = br.ReadString(); retVal.MD5 = br.ReadString(); } return(retVal); }