public MemoryStream GetMemoryStream() { MemoryStream aresult = null; if (FStream.Length > 0) { if (FDecompStream != null) { aresult = FDecompStream; } else { FStream.Seek(0, SeekOrigin.Begin); if (StreamUtil.IsCompressed(FStream)) { #if REPMAN_ZLIB FStream.Seek(0, SeekOrigin.Begin); StreamUtil.DeCompressStream(FStream, FDecompStream); aresult = FDecompStream; #else throw new UnNamedException("REPMAN_ZLIB not defined compressed streams not supported"); #endif } else { aresult = FStream; } } } return(aresult); }
public MemoryStream GetStream() { MemoryStream aresult = null; if (Expression.Length > 0) { aresult = Report.Evaluator.GetStreamFromExpression(Expression); if (aresult != null) { if (FOldStream != null) { if (FOldStream.Length == aresult.Length) { if (SharedImage == SharedImageType.Variable) { byte[] sx = FOldStream.ToArray(); byte[] sy = aresult.ToArray(); for (int i = 0; i < FOldStream.Length; i++) { if (sx[i] != sy[i]) { OldStreamPos = -1; break; } } } else { OldStreamPos = -1; } } else { OldStreamPos = -1; } } } } else { if (FStream.Length > 0) { if (FOldStream != null) { aresult = FOldStream; } else { FStream.Seek(0, SeekOrigin.Begin); if (StreamUtil.IsCompressed(FStream)) { #if REPMAN_ZLIB FStream.Seek(0, SeekOrigin.Begin); StreamUtil.DeCompressStream(FStream, FDecompStream); aresult = FDecompStream; #else throw new UnNamedException("REPMAN_ZLIB not defined compressed streams not supported"); #endif } else { aresult = FStream; } } } } FOldStream = aresult; return(aresult); }