private static IcnsElement[] ReadImage(Stream stream) { IcnsHeader icnsHeader = ReadIcnsHeader(stream); List <IcnsElement> icnsElementList = new List <IcnsElement>(); for (int remainingSize = icnsHeader.fileSize - 8; remainingSize > 0;) { IcnsElement icnsElement = ReadIcnsElement(stream); icnsElementList.Add(icnsElement); remainingSize -= icnsElement.elementSize; } IcnsElement[] icnsElements = new IcnsElement[icnsElementList.Count]; for (int i = 0; i < icnsElements.Length; i++) { icnsElements[i] = icnsElementList[i]; } return(icnsElements); }
private static IcnsElement[] ReadImage(Stream stream) { IcnsHeader icnsHeader = ReadIcnsHeader(stream); List<IcnsElement> icnsElementList = new List<IcnsElement>(); for (int remainingSize = icnsHeader.fileSize - 8; remainingSize > 0; ) { IcnsElement icnsElement = ReadIcnsElement(stream); icnsElementList.Add(icnsElement); remainingSize -= icnsElement.elementSize; } IcnsElement[] icnsElements = new IcnsElement[icnsElementList.Count]; for (int i = 0; i < icnsElements.Length; i++) icnsElements[i] = icnsElementList[i]; return icnsElements; }