• Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Design
    Unite UX
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • jQuery
    • Angular
    • React
    • Vue
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class Utilities

Holds a variety of useful functions used in Fiddler and its addons.

Inheritance
System.Object
Utilities
Namespace: Fiddler
Assembly: FiddlerCore.dll

Syntax

public static class Utilities : Object

Fields

emptyByteArray

A static byte array containing 0 elements. Use to avoid having many copies of an empty byte[] floating around.

Declaration
public static readonly byte[] emptyByteArray
Field Value
System.Byte[]

Http2MagicHeader

Magic string that must be sent first by the client when establishing a HTTP2 connection.

Declaration
public static readonly byte[] Http2MagicHeader
Field Value
System.Byte[]

sCommonRequestHeaders

Declaration
public const string sCommonRequestHeaders = "Cache-Control,If-None-Match,If-Modified-Since,Pragma,If-Unmodified-Since,If-Range,If-Match,Content-Length,Content-Type,Referer,Origin,SOAPAction,Expect,Content-Encoding,TE,Transfer-Encoding,Proxy-Connection,Connection,Accept,Accept-Charset,Accept-Encoding,Accept-Language,User-Agent,UA-Color,UA-CPU,UA-OS,UA-Pixels,Cookie,Cookie2,DNT,Authorization,Proxy-Authorization,X-Requested-With,X-Download-Initiator"
Field Value
System.String

sCommonResponseHeaders

Declaration
public const string sCommonResponseHeaders = "Age,Cache-Control,Date,Expires,Pragma,Vary,Content-Length,ETag,Last-Modified,Content-Type,Content-Disposition,Content-Encoding,Transfer-encoding,Via,Keep-Alive,Location,Proxy-Connection,Connection,Set-Cookie,WWW-Authenticate,Proxy-Authenticate,P3P,X-UA-Compatible,X-Frame-options,X-Content-Type-Options,X-XSS-Protection,Strict-Transport-Security,Content-Security-Policy,Access-Control-Allow-Origin,Cross-Origin-Resource-Policy,Cross-Origin-Opener-Policy,Cross-Origin-Embedder-Policy,Cross-Origin-Embedder-Policy-Report-Only,Cross-Origin-Opener-Policy-Report-Only"
Field Value
System.String

SupportedTLS1_3_Ciphers_Client

A list of supported TLS 1.3 ciphers for BouncyCastle Client(macOS only)

Declaration
public static int[] SupportedTLS1_3_Ciphers_Client
Field Value
System.Int32[]

A list of all TLS 1.3 ciphers that should be offered during handshake

SupportedTLS1_3_Ciphers_Server

A list of supported TLS 1.3 ciphers for BouncyCastle Server(macOS only)

Declaration
public static int[] SupportedTLS1_3_Ciphers_Server
Field Value
System.Int32[]

A list of all TLS 1.3 ciphers that should be offered during handshake

Properties

ThisAssemblyVersion

Declaration
public static Version ThisAssemblyVersion { get; }
Property Value
System.Version

Methods

areOriginsEquivalent(String, String, Int32)

Returns TRUE if two ORIGIN (scheme+host+port) values are functionally equivalent.

Declaration
public static bool areOriginsEquivalent(string sOrigin1, string sOrigin2, int iDefaultPort)
Parameters
System.String sOrigin1

The first ORIGIN

System.String sOrigin2

The second ORIGIN

System.Int32 iDefaultPort

The default port, if a port is not specified

Returns
System.Boolean

TRUE if the two origins are equivalent

BrotliCompress(Byte[], out Int64)

Compresses a byte array using Brotli

Declaration
public static byte[] BrotliCompress(byte[] input, out long elapsedMilliseconds)
Parameters
System.Byte[] input

Byte array containing data to compress

System.Int64 elapsedMilliseconds

Outputs the amount of milliseconds it took to compress the data

Returns
System.Byte[]

Byte array compressed with Brotli algorithm

BrotliExpand(Byte[])

Decompresses a byte array using Brotli

Declaration
public static byte[] BrotliExpand(byte[] input)
Parameters
System.Byte[] input

Byte array compressed with Brotli algorithm

Returns
System.Byte[]

Byte array containing decompressed data

ByteArrayToHexView(Byte[], Int32)

Pretty-print a Hex view of a byte array. Slow.

Declaration
[CodeDescription("Returns a string representing a Hex view of a byte array. Slow.")]
public static string ByteArrayToHexView(byte[] inArr, int iBytesPerLine)
Parameters
System.Byte[] inArr

The byte array

System.Int32 iBytesPerLine

Number of bytes per line

Returns
System.String

String containing a pretty-printed array

ByteArrayToHexView(Byte[], Int32, Int32)

Pretty-print a Hex view of a byte array. Slow.

Declaration
[CodeDescription("Returns a string representing a Hex view of a byte array. PERF: Slow.")]
public static string ByteArrayToHexView(byte[] inArr, int iBytesPerLine, int iMaxByteCount)
Parameters
System.Byte[] inArr

The byte array

System.Int32 iBytesPerLine

Number of bytes per line

System.Int32 iMaxByteCount

The maximum number of bytes to pretty-print

Returns
System.String

String containing a pretty-printed array

ByteArrayToHexView(Byte[], Int32, Int32, Boolean)

Pretty-print a Hex view of a byte array. Slow.

Declaration
[CodeDescription("Returns a string representing a Hex view of a byte array. PERF: Slow.")]
public static string ByteArrayToHexView(byte[] inArr, int iBytesPerLine, int iMaxByteCount, bool bShowASCII)
Parameters
System.Byte[] inArr

The byte array

System.Int32 iBytesPerLine

Number of bytes per line

System.Int32 iMaxByteCount

The maximum number of bytes to pretty-print

System.Boolean bShowASCII

Show ASCII text at the end of each line

Returns
System.String

String containing a pretty-printed array

ByteArrayToHexView(Byte[], Int32, Int32, Int32, Boolean)

Declaration
[CodeDescription("Returns a string representing a Hex view of a byte array. PERF: Slow.")]
public static string ByteArrayToHexView(byte[] inArr, int iStartAt, int iBytesPerLine, int iMaxByteCount, bool bShowASCII)
Parameters
System.Byte[] inArr

System.Int32 iStartAt

System.Int32 iBytesPerLine

System.Int32 iMaxByteCount

System.Boolean bShowASCII

Returns
System.String

ByteArrayToString(Byte[])

Print an byte array to a hex string. Slow.

Declaration
[CodeDescription("Returns a string representing a Hex stream of a byte array. Slow.")]
public static string ByteArrayToString(byte[] inArr)
Parameters
System.Byte[] inArr

Byte array

Returns
System.String

String of hex bytes, or "null"/"empty" if no bytes provided

ByteArrayToStringExt(Byte[])

Print an byte array to a hex string without separation. 2-3 times faster than BitConverter.ToString

Declaration
[CodeDescription("Returns a string representing a Hex stream of a byte array. A bit faster.")]
public static string ByteArrayToStringExt(byte[] bytes)
Parameters
System.Byte[] bytes

Byte array

Returns
System.String

String of hex bytes, or "null"/"empty" if no bytes provided

bzip2Compress(Byte[])

Compress a byte[] using the bzip2 algorithm

Declaration
[CodeDescription("Returns a byte[] representing the bzip2'd representation of writeData[]")]
public static byte[] bzip2Compress(byte[] writeData)
Parameters
System.Byte[] writeData

Array to compress

Returns
System.Byte[]

byte[] of data compressed using bzip2

bzip2Expand(Byte[])

Decompress an array compressed using bzip2

Declaration
public static byte[] bzip2Expand(byte[] compressedData)
Parameters
System.Byte[] compressedData

The array to expand

Returns
System.Byte[]

byte[] of decompressed data

bzip2Expand(Byte[], Boolean)

Decompress an array compressed using bzip2

Declaration
public static byte[] bzip2Expand(byte[] compressedData, bool bThrowErrors)
Parameters
System.Byte[] compressedData

The array to expand

System.Boolean bThrowErrors

If True, any errors during decompression will be thrown as an InvalidDataException.

Returns
System.Byte[]

byte[] of decompressed data

CompareVersions(String, Version)

Typically, a version number is displayed as "major number.minor number.build number.private part number".

Declaration
public static int CompareVersions(string sRequiredVersion, Version verTest)
Parameters
System.String sRequiredVersion

Version required

System.Version verTest

Version of the binary being tested

Returns
System.Int32

Returns 0 if exact match, else greater than 0 if Required version greater than verTest

ContentTypeForFilename(String)

Return the content type of a target file, or application/octet-stream if unknown.

Declaration
public static string ContentTypeForFilename(string sFilename)
Parameters
System.String sFilename

A filename, including the extension

Returns
System.String

CrackHostAndPort(String, out String, ref Int32)

This function cracks the Hostname/Port combo, removing IPV6 brackets if needed

Declaration
[CodeDescription("This function cracks the Host/Port combo, removing IPV6 brackets if needed.")]
public static void CrackHostAndPort(string sHostPort, out string sHostname, ref int iPort)
Parameters
System.String sHostPort

Hostname/port combo, like www.foo.com or www.example.com:8888 or [::1]:80

System.String sHostname

The hostname, minus any IPv6 literal brackets, if present

System.Int32 iPort

Port #, 80 if not specified, -1 if corrupt

DeflaterCompress(Byte[])

Compress a byte array using RFC1951 DEFLATE

Declaration
[CodeDescription("Returns a byte[] containing a DEFLATE'd copy of writeData[]")]
public static byte[] DeflaterCompress(byte[] writeData)
Parameters
System.Byte[] writeData

Array to compress

Returns
System.Byte[]

byte[] containing a DEFLATE'd copy of writeData[]

DeflaterCompress(Byte[], CancellationToken)

Compress a byte array using RFC1951 DEFLATE

Declaration
public static Task<byte[]> DeflaterCompress(byte[] writeData, CancellationToken ct)
Parameters
System.Byte[] writeData

Array to compress

System.Threading.CancellationToken ct

CancellationToken used to halt a long running task

Returns
System.Threading.Tasks.Task<System.Byte[]>

byte[] containing a DEFLATE'd copy of writeData[]

DeflaterExpand(Byte[])

Decompress a byte array that was compressed using RFC1951 DEFLATE

Declaration
[CodeDescription("Returns a byte[] representing the INFLATE'd representation of compressedData[]")]
public static byte[] DeflaterExpand(byte[] compressedData)
Parameters
System.Byte[] compressedData

Array to decompress

Returns
System.Byte[]

byte[] of decompressed data

DeflaterExpand(Byte[], Boolean)

Declaration
public static byte[] DeflaterExpand(byte[] compressedData, bool bThrowErrors)
Parameters
System.Byte[] compressedData

System.Boolean bThrowErrors

Returns
System.Byte[]

DeflaterExpandInternal(Byte[])

UnDeflate function which shows no UI and will throw on error

Declaration
public static byte[] DeflaterExpandInternal(byte[] compressedData)
Parameters
System.Byte[] compressedData

byte[] to decompress

Returns
System.Byte[]

A decompressed byte array, or byte[0]. Throws on errors.

doChunk(Byte[], Int32)

Takes a byte array and applies HTTP Chunked Transfer Encoding to it

Declaration
public static byte[] doChunk(byte[] writeData, int iSuggestedChunkCount)
Parameters
System.Byte[] writeData

The byte array to convert

System.Int32 iSuggestedChunkCount

The number of chunks to try to create

Returns
System.Byte[]

The byte array with Chunked Transfer Encoding applied

doUnchunk(Byte[])

Removes HTTP chunked encoding from the data in writeData and returns the resulting array.

Declaration
public static byte[] doUnchunk(byte[] writeData)
Parameters
System.Byte[] writeData

Some chunked data

Returns
System.Byte[]

Unchunked data. Throws InvalidDataException on data format errors.

Dupe(Byte[])

Duplicate a byte array, replacing null with byte[0]. Doing this instead of .Clone() because it better handles nulls and it may be faster.

Declaration
public static byte[] Dupe(byte[] bIn)
Parameters
System.Byte[] bIn

The array to copy

Returns
System.Byte[]

The new array.

EllipsizeIfNeeded(String, Int32)

Ensures that the target string is iMaxLength or fewer characters, appending ... if truncation occurred

Declaration
public static string EllipsizeIfNeeded(string sString, int iMaxLength)
Parameters
System.String sString

The string to trim from

System.Int32 iMaxLength

The maximum number of characters to return

Returns
System.String

The string, or up to iMaxLength-1 characters from the "Head" of the string, with \u2026 appeneded.

EnsureInRange<T>(T, T, T)

Ensures a value is within a specified range.

Declaration
public static T EnsureInRange<T>(T current, T min, T max)
Parameters
T current

Current value

T min

Min value

T max

Max value

Returns
T

Returns the provided value, unless it is outside of the specified range, in which case the nearest "fencepost" is returned.

Type Parameters
T

Type of the value

EnsureOverwritable(String)

Ensure that the target path exists and if a file exists there, it is not readonly or hidden. WARNING: Can throw if target "Filename" calls for a parent directoryname that is already used as a filename by a non-directory. E.g. EnsureOverwriteable(C:\io.sys\filename.txt); would throw.

Declaration
public static void EnsureOverwritable(string sFilename)
Parameters
System.String sFilename

The candidate filename

EnsurePathIsAbsolute(String, String)

Ensure that a given path is absolute, if not, applying the root path. WARNING: This function only works as well as Path.IsPathRooted, which returns "True" for things like "/NoDriveSpecified/fuzzle.txt" A better approach would be to look at the internal Path.IsRelative method

Declaration
public static string EnsurePathIsAbsolute(string sRootPath, string sFilename)
Parameters
System.String sRootPath

System.String sFilename

Returns
System.String

EnsureUniqueFilename(String)

Ensure that the target file does not yet exist. If it does, generates a new filename with an embedded identifier, e.g. out[1].txt instead. Attempts to ensure filename is creatable; e.g. if a path component needs to be a directory but is a file already, injects [#] into that path component.

Declaration
public static string EnsureUniqueFilename(string sFilename)
Parameters
System.String sFilename

Candidate filename

Returns
System.String

New filename which does not yet exist

EnsureValidAsPath(String)

Address the problem where the target "PATH" calls for a directoryname is already a filename

Declaration
public static string EnsureValidAsPath(string sTargetFolder)
Parameters
System.String sTargetFolder

Returns
System.String

FileExtensionForMIMEType(String)

Maps a MIMEType to a file extension. Pass only the TYPE (e.g. use oResponse.MIMEType), to ensure no charset info in the string.

Declaration
public static string FileExtensionForMIMEType(string mime)
Parameters
System.String mime

The MIME Type

Returns
System.String

A file extension for the type, or .TXT

FormatSslVersion(String)

Format the value of a SslProtocol - e.g. 'Tls11' becomes 'TLS 1.1'

Declaration
public static string FormatSslVersion(string sslVersion)
Parameters
System.String sslVersion

String value of the SslProtocol

Returns
System.String

Formatted SslProtocol value

GetCommaTokenValue(String, String)

Returns the Value from a (case-insensitive) token in the header string. Correctly handles double-quoted strings. Allows comma and semicolon as delimiter. Trailing whitespace may be present.

Declaration
public static string GetCommaTokenValue(string sString, string sTokenName)
Parameters
System.String sString

Name of the header

System.String sTokenName

Name of the token

Returns
System.String

Value of the token if present; otherwise, null

GetCustomCertErrorPageTemplate(String, String, String)

Get the template shown when trying to open a URL with an invalid TLS certificate

Declaration
public static string GetCustomCertErrorPageTemplate(string host, string certError, string url)
Parameters
System.String host

The host which fails the certificate check

System.String certError

The certificate error

System.String url

The url which the browser was trying to load

Returns
System.String

A string containing the HTML file content

GetEchoServicePageTemplate(Session)

Get the template shown for the Fiddler echo service (http://[fiddlerhost]:[fiddlerport]/)

Declaration
public static string GetEchoServicePageTemplate(Session oS)
Parameters
Session oS

Session to use for host header if DNS hostname fails

Returns
System.String

A string containing the HTML file content

getEntityBodyEncoding(HTTPHeaders, Byte[])

WARNING: Potentially slow. WARNING: Does not decode the HTTP Response body; if compressed, embedded META or charset will not be checked Gets (via Headers or Sniff) the provided body's text Encoding. If not found, returns CONFIG.oHeaderEncoding (usually UTF-8).

Declaration
[CodeDescription("Gets (via Headers or Sniff) the provided body's text Encoding. Returns CONFIG.oHeaderEncoding (usually UTF-8) if unknown. Potentially slow.")]
public static Encoding getEntityBodyEncoding(HTTPHeaders oHeaders, byte[] oBody)
Parameters
HTTPHeaders oHeaders

HTTP Headers, ideally containing a Content-Type header with a charset attribute.

System.Byte[] oBody

byte[] containing the entity body.

Returns
System.Text.Encoding

A character encoding, if one could be determined

GetExecutableOutput(String, String, out Int32)

Run an executable, wait for it to exit, and return its output as a string. NOTE: Uses CreateProcess, so you cannot launch applications which require Elevation.

Declaration
[CodeDescription("Run an executable, wait for it to exit, and return its output as a string.")]
public static string GetExecutableOutput(string sExecute, string sParams, out int iExitCode)
Parameters
System.String sExecute

Fully-qualified filename of file to Execute

System.String sParams

Command-line parameters to pass

System.Int32 iExitCode

Exit code returned by the executable

Returns
System.String

String containing the standard-output of the executable

GetHostName(Session)

Return the DNS hostname of the machine. If that is not available, return the host header of the session.

Declaration
public static string GetHostName(Session oS)
Parameters
Session oS

Session to use for host header if DNS hostname fails

Returns
System.String

the retrieved hostname

GetInstrumentedBrowserInitialPageTemplate(Session)

Get the template shown when starting a new instrumented browser (https://this.is.fiddler/)

Declaration
public static string GetInstrumentedBrowserInitialPageTemplate(Session _)
Parameters
Session _

Session to use for host header if DNS hostname fails

Returns
System.String

A string containing the HTML file content

GetRegistryBool(RegistryKey, String, Boolean)

Get a bool from the registry

Declaration
[CodeDescription("Returns an bool from the registry, or bDefault if the registry key is missing or cannot be used as an bool.")]
public static bool GetRegistryBool(RegistryKey oReg, string sName, bool bDefault)
Parameters
Microsoft.Win32.RegistryKey oReg

The RegistryKey

System.String sName

The Value name

System.Boolean bDefault

The default value

Returns
System.Boolean

Returns an bool from the registry, or bDefault if the registry key is missing or cannot be used as an bool.

GetRegistryFloat(RegistryKey, String, Single)

Returns an Float from the registry, or a default.

Declaration
[CodeDescription("Returns an float from the registry, or flDefault if the registry key is missing or cannot be used as an float.")]
public static float GetRegistryFloat(RegistryKey oReg, string sName, float flDefault)
Parameters
Microsoft.Win32.RegistryKey oReg

Registry key in which to find the value.

System.String sName

The value name.

System.Single flDefault

The default float value if the registry key is missing or cannot be used as a float.

Returns
System.Single

Float representing the value, or the default.

GetRegistryInt(RegistryKey, String, Int32)

Returns an integer from the registry, or a default.

Declaration
[CodeDescription("Returns an integer from the registry, or iDefault if the registry key is missing or cannot be used as an integer.")]
public static int GetRegistryInt(RegistryKey oReg, string sName, int iDefault)
Parameters
Microsoft.Win32.RegistryKey oReg

The Registry key in which to find the value.

System.String sName

The registry value name.

System.Int32 iDefault

Default to return if the registry key is missing or cannot be used as an integer

Returns
System.Int32

The retrieved integer, or the default.

GetRemoteDeviceConnectivityPageTemplate(Session)

Get the template shown on remote devices at the end of the remote device setup wizard (https://fiddler.device/)

Declaration
public static string GetRemoteDeviceConnectivityPageTemplate(Session oS)
Parameters
Session oS

Session to use for host header if DNS hostname fails

Returns
System.String

A string containing the HTML file content

GetRequestHeaders(Session)

Get the Request headers as key-value pairs, including the pseudo headers.

Declaration
public static KeyValuePair<string, string>[] GetRequestHeaders(Session oSession)
Parameters
Session oSession

The session

Returns
System.Collections.Generic.KeyValuePair<System.String, System.String>[]

The Request headers, including the pseudo headers.

getResponseBodyEncoding(Session)

Gets (via Headers or Sniff) the Response Text Encoding. Returns CONFIG.oHeaderEncoding (usually UTF-8) if unknown. Perf: May be quite slow; cache the response

Declaration
[CodeDescription("Gets (via Headers or Sniff) the Response Text Encoding. Returns CONFIG.oHeaderEncoding (usually UTF-8) if unknown. Potentially slow.")]
public static Encoding getResponseBodyEncoding(Session oSession)
Parameters
Session oSession

The session

Returns
System.Text.Encoding

The encoding of the response body

GetResponseHeaders(Session)

Get the Response headers as key-value pairs

Declaration
public static KeyValuePair<string, string>[] GetResponseHeaders(Session oSession)
Parameters
Session oSession

The session

Returns
System.Collections.Generic.KeyValuePair<System.String, System.String>[]

The Response headers

GetStringFromArrayRemovingBOM(Byte[], Encoding)

Gets a string from a byte-array, stripping a Byte Order Marker preamble if present.

Declaration
[CodeDescription("Gets a string from a byte-array, stripping a BOM if present.")]
public static string GetStringFromArrayRemovingBOM(byte[] arrInput, Encoding oDefaultEncoding)
Parameters
System.Byte[] arrInput

The byte array

System.Text.Encoding oDefaultEncoding

The encoding to convert from if there's no Byte-order-marker

Returns
System.String

The string

Remarks

This function really shouldn't need to exist. Why doesn't calling .GetString on a string with a preamble remove the preamble???

GetTextEncoding(String)

WARNING: May throw. Gets an encoding, with proper respect for "utf8" as an alias for "utf-8"; Microsoft products don't support this prior to 2015-era, but it turns out to be common. We do have a linter elsewhere that reports a warning if it sees the dashless form. https://github.com/telerik/fiddler/issues/38

Declaration
public static Encoding GetTextEncoding(string sEncoding)
Parameters
System.String sEncoding

Textual name of the encoding

Returns
System.Text.Encoding

GetTickCount()

Get a TickCount (milliseconds since system start) as an unsigned 64bit value. On Windows Vista+, uses the GetTickCount64 API that won't rollover, but on any other platform, this unsigned wrapper moves the rollover point to 49 days of uptime.

Declaration
public static ulong GetTickCount()
Returns
System.UInt64

Number of ms since the system started

GzipCompress(Byte[])

GZIPs a byte-array

Declaration
[CodeDescription("Returns a byte[] containing a gzip-compressed copy of writeData[]")]
public static byte[] GzipCompress(byte[] writeData)
Parameters
System.Byte[] writeData

Input byte array

Returns
System.Byte[]

byte[] containing a gzip-compressed copy of writeData[]

GzipExpand(Byte[])

Expands a GZIP-compressed byte array

Declaration
[CodeDescription("Returns a byte[] containing an un-gzipped copy of compressedData[]")]
public static byte[] GzipExpand(byte[] compressedData)
Parameters
System.Byte[] compressedData

The array to decompress

Returns
System.Byte[]

byte[] containing an un-gzipped copy of compressedData[]

GzipExpand(Byte[], Boolean)

Declaration
public static byte[] GzipExpand(byte[] compressedData, bool bThrowErrors)
Parameters
System.Byte[] compressedData

System.Boolean bThrowErrors

Returns
System.Byte[]

GzipExpandInternal(Byte[])

GZIP-Expand function which shows no UI and will throw on error

Declaration
public static byte[] GzipExpandInternal(byte[] compressedData)
Parameters
System.Byte[] compressedData

byte[] to decompress

Returns
System.Byte[]

A decompressed byte array, or byte[0]. Throws on errors.

HasMagicBytes(Byte[], Byte[])

Determines whether the arrData array STARTS WITH with the supplied arrMagics bytes. Used for Content-Type sniffing.

Declaration
public static bool HasMagicBytes(byte[] arrData, byte[] arrMagics)
Parameters
System.Byte[] arrData

The data, or null

System.Byte[] arrMagics

The MagicBytes to look for

Returns
System.Boolean

TRUE if arrData begins with arrMagics

HasMagicBytes(Byte[], Int32, Byte[])

Declaration
public static bool HasMagicBytes(byte[] arrData, int iXOffset, byte[] arrMagics)
Parameters
System.Byte[] arrData

System.Int32 iXOffset

System.Byte[] arrMagics

Returns
System.Boolean

HasMagicBytes(Byte[], String)

Determines whether the arrData array begins with the supplied sMagics ASCII text. Used for Content-Type sniffing.

Declaration
public static bool HasMagicBytes(byte[] arrData, string sMagics)
Parameters
System.Byte[] arrData

The data, or null

System.String sMagics

The ASCII text to look for

Returns
System.Boolean

TRUE if arrData begins with sMagics (encoded as ASCII octets)

HasResponseHeaders(Session)

Checks if the session has response headers

Declaration
public static bool HasResponseHeaders(Session oSession)
Parameters
Session oSession

The session

Returns
System.Boolean

true if the session has response headers

HtmlEncode(String)

HtmlEncode a string. In Fiddler itself, this is a simple wrapper for the System.Web.HtmlEncode function. The .NET3.5/4.0 Client Profile doesn't include System.Web, so we must provide our own implementation of HtmlEncode for FiddlerCore's use.

Declaration
public static string HtmlEncode(string sInput)
Parameters
System.String sInput

String to encode

Returns
System.String

String encoded according to the rules of HTML Encoding, or null.

HTTPMethodAllowsBody(String)

Returns true if a request with the specified HTTP Method/Verb may contain a entity body

Declaration
[CodeDescription("Returns TRUE if the HTTP Method MAY have a body.")]
public static bool HTTPMethodAllowsBody(string sMethod)
Parameters
System.String sMethod

The Method/Verb

Returns
System.Boolean

TRUE if the HTTP Method MAY contain a request body.

HTTPMethodIsIdempotent(String)

http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-4.2.2

Declaration
public static bool HTTPMethodIsIdempotent(string sMethod)
Parameters
System.String sMethod

HTTPMethod

Returns
System.Boolean

TRUE if the method is deemed idempotent

HTTPMethodRequiresBody(String)

Determines true if a request with the specified HTTP Method/Verb MUST contain a entity body

Declaration
[CodeDescription("Returns TRUE if the HTTP Method MUST have a body.")]
public static bool HTTPMethodRequiresBody(string sMethod)
Parameters
System.String sMethod

The Method/Verb

Returns
System.Boolean

TRUE if the HTTP Method MUST contain a request body.

HTTPStatusAllowsBody(Int32)

Declaration
[CodeDescription("Returns TRUE if a response body is allowed for this responseCode.")]
public static bool HTTPStatusAllowsBody(int iResponseCode)
Parameters
System.Int32 iResponseCode

Returns
System.Boolean

IndexOfNth(String, Int32, Char)

Declaration
public static int IndexOfNth(string sString, int n, char chSeek)
Parameters
System.String sString

System.Int32 n

System.Char chSeek

Returns
System.Int32

IPEndPointFromHostPortString(String)

Given a string/list in the form HOSTNAME:PORT#;HOSTNAME2:PORT2#, this function returns the FIRST IPEndPoint. Defaults to port 80 if not specified. Warning: DNS resolution is slow, so use this function wisely.

Declaration
public static IPEndPoint IPEndPointFromHostPortString(string sHostAndPort)
Parameters
System.String sHostAndPort

HOSTNAME:PORT#;OPTHOST2:PORT2#

Returns
System.Net.IPEndPoint

An IPEndPoint or null

IPEndPointListFromHostPortString(String)

Given a string/list in the form HOSTNAME:PORT#;HOSTNAME2:PORT2#, this function returns all IPEndPoints for ALL listed hosts. Defaults to port 80 if not specified. Warning: DNS resolution is slow, so use this function wisely.

Declaration
public static IPEndPoint[] IPEndPointListFromHostPortString(string sAllHostAndPorts)
Parameters
System.String sAllHostAndPorts

HOSTNAME:PORT#;OPTHOST2:PORT2#

Returns
System.Net.IPEndPoint[]

An array of IPEndPoints or null if no results were obtained

IPFromString(String)

This function attempts to be a ~fast~ way to return an IP from a hoststring that contains an IPv4/6-Literal.

Declaration
[CodeDescription("This function attempts to be a ~fast~ way to return an IP from a hoststring that contains an IP-Literal. ")]
public static IPAddress IPFromString(string sHost)
Parameters
System.String sHost

Hostname

Returns
System.Net.IPAddress

IPAddress, or null, if the sHost wasn't an IP-Literal

IsBinaryMIME(String)

Determines if the specified MIME type is "binary" in nature.

Declaration
public static bool IsBinaryMIME(string sContentType)
Parameters
System.String sContentType

The MIME type

Returns
System.Boolean

TRUE if the MIME type is likely binary in nature

IsBrowserProcessName(String)

For a given process name, returns a bool indicating whether this is a known browser process name.

Declaration
public static bool IsBrowserProcessName(string sProcessName)
Parameters
System.String sProcessName

The Process name (e.g. "abrowser.exe")

Returns
System.Boolean

Returns true if the process name starts with a common browser process name (e.g. ie, firefox, etc)

IsCommentUserSupplied(String)

Returns TRUE if the string is non-empty and not of the pattern "[#123]" Necessary because SAZ-saving logic autogenerates comments of that form

Declaration
public static bool IsCommentUserSupplied(string strComment)
Parameters
System.String strComment

Returns
System.Boolean

isLocalhost(String)

This function cracks a sHostPort string to determine if the address refers to the local computer

Declaration
[CodeDescription("Returns true if True if the sHostAndPort's host is 127.0.0.1, 'localhost', or ::1. Note that list is not complete.")]
public static bool isLocalhost(string sHostAndPort)
Parameters
System.String sHostAndPort

The string to evaluate, potentially containing a port

Returns
System.Boolean

True if the address is 127.0.0.1, 'localhost', or ::1

isLocalhostname(String)

Determines if the specified Hostname is a either 'localhost' or an IPv4 or IPv6 loopback literal

Declaration
[CodeDescription("Returns true if True if the sHostname is 127.0.0.1, 'localhost', or ::1. Note that list is not complete.")]
public static bool isLocalhostname(string sHostname)
Parameters
System.String sHostname

Hostname (no port)

Returns
System.Boolean

TRUE if the hostname is equivalent to localhost

IsNullOrEmpty(Byte[])

Returns TRUE if the array is null or contains 0 bytes

Declaration
public static bool IsNullOrEmpty(byte[] bIn)
Parameters
System.Byte[] bIn

byte[] to test

Returns
System.Boolean

isPlainHostName(String)

This function cracks a sHostPort string to determine if the address refers to a "local" site

Declaration
[CodeDescription("Returns false if Hostname contains any dots or colons.")]
public static bool isPlainHostName(string sHostAndPort)
Parameters
System.String sHostAndPort

The string to evaluate, potentially containing a port

Returns
System.Boolean

True if the address is local

IsRedirect(Session)

Checks if the session is a Redirect

Declaration
public static bool IsRedirect(Session oSession)
Parameters
Session oSession

The session

Returns
System.Boolean

true if the session is a Redirect

IsRedirectStatus(Int32)

Declaration
public static bool IsRedirectStatus(int iResponseCode)
Parameters
System.Int32 iResponseCode

Returns
System.Boolean

isUnsupportedEncoding(String, String)

Implements a BlockList for "unknown" encodings that the utilDecode* functions cannot handle

Declaration
public static bool isUnsupportedEncoding(string sTE, string sCE)
Parameters
System.String sTE

Transfer-Encoding

System.String sCE

Content-Encoding

Returns
System.Boolean

TRUE if any encoding is known to be unsupported

JoinByteArrays(Byte[], Byte[])

Create a new byte[] containing the contents of two other byte arrays.

Declaration
public static byte[] JoinByteArrays(byte[] arr1, byte[] arr2)
Parameters
System.Byte[] arr1

System.Byte[] arr2

Returns
System.Byte[]

LaunchHyperlink(String)

Launch the user's browser to a hyperlink. This function traps exceptions and notifies the user via UI dialog.

Declaration
[CodeDescription("ShellExecutes the sURL.")]
public static bool LaunchHyperlink(string sURL)
Parameters
System.String sURL

The URL to ShellExecute.

Returns
System.Boolean

TRUE if the ShellExecute call succeeded.

Parameterize(String)

Declaration
[CodeDescription("Tokenize a string into tokens. Delimits on whitespace; \" marks are dropped unless preceded by \\ characters.")]
public static string[] Parameterize(string sInput)
Parameters
System.String sInput

Returns
System.String[]

Parameterize(String, Boolean)

Tokenize a string into tokens. Delimits on unquoted whitespace ; quote marks are dropped unless preceded by \ characters. Some special hackery to allow trailing slash not escape the final character of the entire input, so that: prefs set fiddler.config.path.vsplugins "F:\users\ericlaw\VSWebTest&quot; ...doesn't end up with a trailing quote.

Declaration
[CodeDescription("Tokenize a string into tokens. Delimits on whitespace; \" marks are dropped unless preceded by \\ characters.")]
public static string[] Parameterize(string sInput, bool bAllowSQuote)
Parameters
System.String sInput

The string to tokenize

System.Boolean bAllowSQuote

Are single-quotes allowed to as escapes?

Returns
System.String[]

An array of strings

PrefixEllipsizeIfNeeded(String, Int32)

Declaration
public static string PrefixEllipsizeIfNeeded(string sString, int iMaxLength)
Parameters
System.String sString

System.Int32 iMaxLength

Returns
System.String

ReadEntireStream(Stream)

Declaration
public static byte[] ReadEntireStream(Stream oS)
Parameters
System.IO.Stream oS

Returns
System.Byte[]

ReadEntireStream(Stream, Byte[])

Fills an array completely using the provided stream. Unlike a normal .Read(), this one will always fully fill the array unless the Stream throws.

Declaration
[CodeDescription("Reads oStream until arrBytes is filled.")]
public static int ReadEntireStream(Stream oStream, byte[] arrBytes)
Parameters
System.IO.Stream oStream

The stream from which to read.

System.Byte[] arrBytes

The byte array into which the data should be stored.

Returns
System.Int32

The count of bytes read.

ReadSessionArchive(String, String, GetPasswordDelegate, out String, Boolean, Boolean)

Reads a Session Archive Zip file into an array of Session objects

Declaration
[CodeDescription("Load the specified .SAZ or .ZIP session archive")]
public static Session[] ReadSessionArchive(string sFilename, string sContext, GetPasswordDelegate fnPasswordCallback, out string sazVersion, bool skipNewSessionEvent = false, bool skipOriginalIdComment = false)
Parameters
System.String sFilename

Filename to load

System.String sContext

Context for displaying errors

GetPasswordDelegate fnPasswordCallback

Delegate to use to prompt for password if importing encrypted archive

System.String sazVersion

Outputs the version of the read Session Archive Zip file

System.Boolean skipNewSessionEvent

Specifies if the Session.SessionCreated event should be raised for each session in the archive of not.

System.Boolean skipOriginalIdComment

Specifies if the sessions without comments should ge their original Id as an auto-generated comment of not.

Returns
Session[]

Loaded array of sessions or null, in case of failure

ReadSessionArchive(String, String, out String)

Reads a Session Archive Zip file into an array of Session objects

Declaration
public static Session[] ReadSessionArchive(string sFilename, string sContext, out string sazVersion)
Parameters
System.String sFilename

Filename to load

System.String sContext

Context for displaying errors

System.String sazVersion

Outputs the version of the read SAZ file

Returns
Session[]

Loaded array of sessions or null, in case of failure

ReadSessionArchive(String, out String)

Reads a Session Archive Zip file into an array of Session objects

Declaration
public static Session[] ReadSessionArchive(string sFilename, out string sazVersion)
Parameters
System.String sFilename

Filename to load

System.String sazVersion

Outputs the version of the read SAZ file

Returns
Session[]

Loaded array of sessions or null, in case of failure

RecoverMemory()

Garbage collect and, if possible, compact the Large Object heap

Declaration
public static void RecoverMemory()

ResolveProtocol(Session)

Calculate the session protocol

Declaration
public static SessionProtocol ResolveProtocol(Session oSession)
Parameters
Session oSession

The session

Returns
SessionProtocol

ResolveType(Session, Boolean)

Calculate the session type.

Declaration
public static SessionType ResolveType(Session oSession, bool resolveTypeBeforeSessionIsDone = false)
Parameters
Session oSession

The session

System.Boolean resolveTypeBeforeSessionIsDone

Return the actual sessionType even if the session is not in state Done or Aborted

Returns
SessionType

the type of the session

RunExecutable(String, String)

Wrapper for Process.Start that shows error messages in the event of failure.

Declaration
public static bool RunExecutable(string sExecute, string sParams)
Parameters
System.String sExecute

Fully-qualified filename to execute.

System.String sParams

Command line parameters to pass.

Returns
System.Boolean

TRUE if the execution succeeded. FALSE if the execution failed. An error message will be shown for any error except the user declining UAC.

RunExecutableAndWait(String, String)

Run an executable and wait for it to exit, notifying the user of any exceptions.

Declaration
[CodeDescription("Run an executable and wait for it to exit.")]
public static bool RunExecutableAndWait(string sExecute, string sParams)
Parameters
System.String sExecute

Fully-qualified filename of file to execute.

System.String sParams

Command-line parameters to pass.

Returns
System.Boolean

TRUE if the execution succeeded. FALSE if the error message was shown.

SanitizeFileName(String)

Remove invalid characters from a file name (no extension)

Declaration
public static string SanitizeFileName(string fileName)
Parameters
System.String fileName

File name to sanitize (without the extension)

Returns
System.String

The file name with all special characters replaced with a dash

SetRegistryString(RegistryKey, String, String)

Save a string to the registry. Correctly handles null Value, saving as String.Empty

Declaration
[CodeDescription("Save a string to the registry. Correctly handles null Value, saving as String.Empty.")]
public static void SetRegistryString(RegistryKey oReg, string sName, string sValue)
Parameters
Microsoft.Win32.RegistryKey oReg

The registry key into which the value will be written.

System.String sName

The name of the value.

System.String sValue

The value to write.

ToBcProtocolVersion(SslProtocols)

Declaration
public static ProtocolVersion ToBcProtocolVersion(SslProtocols value)
Parameters
System.Security.Authentication.SslProtocols value

Returns
Org.BouncyCastle.Tls.ProtocolVersion

ToDotNetCertificates(Certificate)

Declaration
public static IList<X509Certificate2> ToDotNetCertificates(Certificate certificate)
Parameters
Org.BouncyCastle.Tls.Certificate certificate

Returns
System.Collections.Generic.IList<System.Security.Cryptography.X509Certificates.X509Certificate2>

TrimAfter(String, Char)

Returns the "Head" of a string, before and not including the first instance of specified delimiter.

Declaration
[CodeDescription("Returns the part of a string up to (but NOT including) the first instance of specified delimiter. If delim not found, returns entire string.")]
public static string TrimAfter(string sString, char chDelim)
Parameters
System.String sString

The string to trim from.

System.Char chDelim

The delimiting character at which the trim should end.

Returns
System.String

Part of a string up to (but not including) chDelim, or the full string if chDelim was not found.

TrimAfter(String, Int32)

[Deprecated] Ensures that the target string is iMaxLength or fewer characters

Declaration
public static string TrimAfter(string sString, int iMaxLength)
Parameters
System.String sString

The string to trim from

System.Int32 iMaxLength

The maximum number of characters to return

Returns
System.String

Up to iMaxLength characters from the "Head" of the string.

Remarks

Identical to the TrimTo(String, Int32) method.

TrimAfter(String, String)

Returns the "Head" of a string, before and not including a specified search string.

Declaration
[CodeDescription("Returns the part of a string up to (but NOT including) the first instance of specified substring. If delim not found, returns entire string.")]
public static string TrimAfter(string sString, string sDelim)
Parameters
System.String sString

The string to trim from

System.String sDelim

The delimiting string at which the trim should end.

Returns
System.String

Part of a string up to (but not including) sDelim, or the full string if sDelim was not found.

TrimBefore(String, Char)

Returns the "Tail" of a string, after (but NOT including) the First instance of specified delimiter. See also TrimBeforeLast(String, Char)

Declaration
[CodeDescription("Returns the part of a string after (but NOT including) the first instance of specified delimiter. If delim not found, returns entire string.")]
public static string TrimBefore(string sString, char chDelim)
Parameters
System.String sString

The string to trim from.

System.Char chDelim

The delimiting character after which the text should be returned.

Returns
System.String

Part of a string after (but not including) chDelim, or the full string if chDelim was not found.

TrimBefore(String, String)

Returns the "Tail" of a string, after (but NOT including) the First instance of specified search string. TrimBeforeLast(String, String)

Declaration
[CodeDescription("Returns the part of a string after (but NOT including) the first instance of specified substring. If delim not found, returns entire string.")]
public static string TrimBefore(string sString, string sDelim)
Parameters
System.String sString

The string to trim from.

System.String sDelim

The delimiting string after which the text should be returned.

Returns
System.String

Part of a string after (but not including) sDelim, or the full string if sDelim was not found.

TrimBeforeLast(String, Char)

Returns the "Tail" of a string, after (but not including) the Last instance of specified delimiter. TrimBefore(String, Char)

Declaration
[CodeDescription("Returns the part of a string after (but not including) the last instance of specified delimiter. If delim not found, returns entire string.")]
public static string TrimBeforeLast(string sString, char chDelim)
Parameters
System.String sString

The string to trim from.

System.Char chDelim

The delimiting character after which text should be returned.

Returns
System.String

Part of a string after (but not including) the final chDelim, or the full string if chDelim was not found.

TrimBeforeLast(String, String)

Returns the "Tail" of a string, after (but not including) the Last instance of specified substring. TrimBefore(String, String)

Declaration
[CodeDescription("Returns the part of a string after (but not including) the last instance of specified substring. If delim not found, returns entire string.")]
public static string TrimBeforeLast(string sString, string sDelim)
Parameters
System.String sString

The string to trim from.

System.String sDelim

The delimiting string after which text should be returned.

Returns
System.String

Part of a string after (but not including) the final sDelim, or the full string if sDelim was not found.

TrimTo(String, Int32)

Ensures that the target string is iMaxLength or fewer characters

Declaration
[CodeDescription("Returns the first iMaxLength or fewer characters from the target string.")]
public static string TrimTo(string sString, int iMaxLength)
Parameters
System.String sString

The string to trim from

System.Int32 iMaxLength

The maximum number of characters to return

Returns
System.String

Up to iMaxLength characters from the "Head" of the string.

TrimUpTo(String, String)

Returns the "Tail" of a string, after (and including) the first instance of specified search string.

Declaration
[CodeDescription("Returns the part of a string after (and including) the first instance of specified substring. If delim not found, returns entire string.")]
public static string TrimUpTo(string sString, string sDelim)
Parameters
System.String sString

The string to trim from.

System.String sDelim

The delimiting string at which the text should be returned.

Returns
System.String

Part of the string starting with sDelim, or the entire string if sDelim not found.

TryHexParse(String, out Int32)

Try parsing the string for a Hex-formatted int. If it fails, return false and 0 in iOutput.

Declaration
[CodeDescription("Try parsing the string for a Hex-formatted int. If it fails, return false and 0 in iOutput.")]
public static bool TryHexParse(string sInput, out int iOutput)
Parameters
System.String sInput

The hex number

System.Int32 iOutput

The int value

Returns
System.Boolean

TRUE if the parsing succeeded

UNSTABLE_DescribeClientHello(MemoryStream)

Parses the Client Hello part of a TLS handshake

Declaration
public static string UNSTABLE_DescribeClientHello(MemoryStream msHello)
Parameters
System.IO.MemoryStream msHello

a byte stream containing the handshake data

Returns
System.String

String containing the client handshake data

UNSTABLE_DescribeServerHello(MemoryStream)

Parses the Server Hello part of a TLS handshake

Declaration
public static string UNSTABLE_DescribeServerHello(MemoryStream msHello)
Parameters
System.IO.MemoryStream msHello

a byte stream containing the handshake data

Returns
System.String

String containing the server handshake data

UrlDecode(String)

Convert the %-encoded string into a string, interpreting %-escape sequences as UTF-8 characters

Declaration
public static string UrlDecode(string sInput)
Parameters
System.String sInput

%-encoded string

Returns
System.String

Unencoded string

UrlEncode(String)

Declaration
public static string UrlEncode(string sInput)
Parameters
System.String sInput

Returns
System.String

UrlEncode(String, Encoding)

Declaration
public static string UrlEncode(string sInput, Encoding oEnc)
Parameters
System.String sInput

System.Text.Encoding oEnc

Returns
System.String

UrlPathEncode(String)

Replaces System.Web.HttpUtility.UrlPathEncode(str).

Declaration
public static string UrlPathEncode(string str)
Parameters
System.String str

String to encode as a URL Path

Returns
System.String

Encoded string

UrlsEquals(String, String)

Compare urls by ignoring the case trimming invalid chars.

Declaration
public static bool UrlsEquals(string url1, string url2)
Parameters
System.String url1

System.String url2

Returns
System.Boolean

utilDecodeGRPCMessage(HTTPHeaders, ref Byte[])

Decode the provided data using the encoding specified in the grpc-encoding header

Declaration
public static void utilDecodeGRPCMessage(HTTPHeaders oHeaders, ref byte[] data)
Parameters
HTTPHeaders oHeaders

Headers specifying what encodings are applied

System.Byte[] data

In/Out array to be modified

utilDecodeHTTPBody(HTTPHeaders, ref Byte[])

Remove all encodings from arrBody, based on those specified in the supplied HTTP headers; DOES NOT MODIFY HEADERS. Throws on errors.

Declaration
public static void utilDecodeHTTPBody(HTTPHeaders oHeaders, ref byte[] arrBody)
Parameters
HTTPHeaders oHeaders

Readonly headers specifying what encodings are applied

System.Byte[] arrBody

In/Out array to be modified

utilDecodeHTTPBody(HTTPHeaders, ref Byte[], Boolean)

Remove all encodings from arrBody, based on those specified in the supplied HTTP headers; DOES NOT MODIFY HEADERS. DOES NOT HANDLE UNSUPPORTED ENCODINGS WELL. Throws on errors.

Declaration
public static void utilDecodeHTTPBody(HTTPHeaders oHeaders, ref byte[] arrBody, bool bSilent)
Parameters
HTTPHeaders oHeaders

Readonly headers specifying what encodings are applied

System.Byte[] arrBody

In/Out array to be modified

System.Boolean bSilent

FALSE to show dialog boxes on errors, TRUE to remain silent

utilDecodeWebsocketMessage(String, ref Byte[])

Decode provided data using the encoding specified in Sec-WebSocket-Extensions header

Declaration
public static void utilDecodeWebsocketMessage(string encoding, ref byte[] data)
Parameters
System.String encoding

Websocket messages encoding

System.Byte[] data

In/out payload array to be decoded

WriteArrayToFile(String, Byte[])

Writes arrBytes to a file, creating the target directory and overwriting if the file exists.

Declaration
[CodeDescription("Writes arrBytes to a file, creating the target directory and overwriting if the file exists.")]
public static void WriteArrayToFile(string sFilename, byte[] arrBytes)
Parameters
System.String sFilename

Path to File to write.

System.Byte[] arrBytes

Bytes to write.

WriteSessionArchive(String, Session[], String, Boolean)

Create a Session Archive Zip file containing the specified sessions

Declaration
[CodeDescription("Save the specified .SAZ session archive")]
public static bool WriteSessionArchive(string sFilename, Session[] arrSessions, string sPassword, bool allowEmpty = false)
Parameters
System.String sFilename

The filename of the SAZ file to store

Session[] arrSessions

Array of sessions to store

System.String sPassword

Password to encrypt the file with, or null

System.Boolean allowEmpty

TRUE to write an empty saz

Returns
System.Boolean

XpressExpand(Byte[])

Decompress a byte array that was compressed using Microsoft's Xpress Raw format. Available only on Windows 8+

Declaration
public static byte[] XpressExpand(byte[] arrBlock)
Parameters
System.Byte[] arrBlock

Array to decompress

Returns
System.Byte[]

byte[] of decompressed data

ZstdCompress(Byte[])

Compresses an input byte array with zstd

Declaration
[CodeDescription("Returns a byte[] containing a zstd-compressed copy of writeData[]")]
public static byte[] ZstdCompress(byte[] writeData)
Parameters
System.Byte[] writeData

Input byte array

Returns
System.Byte[]

byte[] containing a zstd-compressed copy of writeData[]

ZstdExpand(Byte[])

Decompress a byte array that was compressed using zstd

Declaration
[CodeDescription("Returns a byte[] containing an decompressed copy of compressedData[]")]
public static byte[] ZstdExpand(byte[] compressedData)
Parameters
System.Byte[] compressedData

Array to decompress

Returns
System.Byte[]

byte[] containing an decompressed copy of compressedData[]

ZstdExpand(Byte[], Boolean)

Decompress a byte array that was compressed using zstd

Declaration
public static byte[] ZstdExpand(byte[] compressedData, bool throwErrors)
Parameters
System.Byte[] compressedData

Array to decompress

System.Boolean throwErrors

throw exception on error

Returns
System.Byte[]

byte[] containing an decompressed copy of compressedData[]

Exceptions
System.IO.InvalidDataException

Getting Started
  • Try Now
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.