Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Class AutoCompressString

A immutable class that wraps a string with support for compression

Inheritance
System.Object
AutoCompressString
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Util
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public class AutoCompressString
Remarks

Important! You cannot change the state of this class after compression

Constructors

AutoCompressString(String)

Initializes a new instance of the AutoCompressString class.

Declaration
public AutoCompressString(string str)
Parameters
Type Name Description
System.String str

The string to be wrapped

Fields

Empty

An empty string

Declaration
public static readonly AutoCompressString Empty
Field Value
Type Description
AutoCompressString

Methods

SetThreshold(Int32)

Set the global threshold for when strings are compressed

Declaration
public static void SetThreshold(int val)
Parameters
Type Name Description
System.Int32 val

The size of the threshold

ToString()

Main method to read string value

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()
Remarks

This method is stateless and must always be

WriteTo(TextWriter)

Unzip compressed data and stream to writer

Declaration
public void WriteTo(TextWriter writer)
Parameters
Type Name Description
System.IO.TextWriter writer

Extension Methods