dxFeed .Net API  5.8.0
dxFeed .Net API library intended to provide market data access for DX clients
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
com.dxfeed.io.StreamCompression Class Reference

Defines byte stream compression format. More...

Collaboration diagram for com.dxfeed.io.StreamCompression:
[legend]

Public Types

enum  CompressionType { CompressionType.None, CompressionType.Gzip, CompressionType.Zip }
 Supported compression types. More...
 

Public Member Functions

Stream Decompress (Stream inputStream)
 Decompresses the given input stream with this compression format. More...
 

Static Public Member Functions

static StreamCompression DetectCompressionByMimeType (string mimeType)
 Detects compression format by the mime type. More...
 
static StreamCompression DetectCompressionByExtension (string fileName)
 Detects compression format by the extension at the end of the file name. More...
 
static StreamCompression DetectCompressionByExtension (Uri fileUri)
 Detects compression format by the extension at the end of the file name. More...
 

Static Public Attributes

static StreamCompression NONE = new StreamCompression(CompressionType.None, "none", "", "")
 No compression. More...
 
static StreamCompression GZIP = new StreamCompression(CompressionType.Gzip, "gzip", "application/gzip", ".gz")
 Gzip compression format. More...
 
static StreamCompression ZIP = new StreamCompression(CompressionType.Zip, "zip", "application/zip", ".zip")
 Zip compression format. More...
 

Private Member Functions

 StreamCompression (CompressionType type, string name, string mimeType, string extension)
 

Private Attributes

CompressionType type
 
string name
 
string mimeType
 
string extension
 

Detailed Description

Defines byte stream compression format.

Supported compression formats are: NONE, GZIP(.gz), ZIP(.zip). NONE compression format serves as a null object and does not do anything.

Member Enumeration Documentation

◆ CompressionType

Supported compression types.

Enumerator
None 
Gzip 
Zip 

Constructor & Destructor Documentation

◆ StreamCompression()

com.dxfeed.io.StreamCompression.StreamCompression ( CompressionType  type,
string  name,
string  mimeType,
string  extension 
)
inlineprivate

Member Function Documentation

◆ Decompress()

Stream com.dxfeed.io.StreamCompression.Decompress ( Stream  inputStream)
inline

Decompresses the given input stream with this compression format.

Parameters
inputStreamIn the input stream.
Returns
The decompressed stream or an original stream if this compression format is NONE.
Exceptions
ArgumentExceptionIf input stream is null.
IOExceptionIf an I/O error occurs.

◆ DetectCompressionByExtension() [1/2]

static StreamCompression com.dxfeed.io.StreamCompression.DetectCompressionByExtension ( string  fileName)
inlinestatic

Detects compression format by the extension at the end of the file name.

Parameters
fileNameThe file name.
Returns
Detected compression format or NONE is the file name extension is not recognized.
Exceptions
ArgumentExceptionIf fileName is null.

◆ DetectCompressionByExtension() [2/2]

static StreamCompression com.dxfeed.io.StreamCompression.DetectCompressionByExtension ( Uri  fileUri)
inlinestatic

Detects compression format by the extension at the end of the file name.

Parameters
fileUriThe file name Uri object.
Returns
Detected compression format or NONE is the file name extension is not recognized.
Exceptions
ArgumentExceptionIf fileUri is null.

◆ DetectCompressionByMimeType()

static StreamCompression com.dxfeed.io.StreamCompression.DetectCompressionByMimeType ( string  mimeType)
inlinestatic

Detects compression format by the mime type.

Parameters
mimeTypeThe mime type.
Returns
Detected compression format or NONE is the mime type is not recognized.
Exceptions
ArgumentNullExceptionIf mimeType is null.

Field Documentation

◆ extension

string com.dxfeed.io.StreamCompression.extension
private

◆ GZIP

StreamCompression com.dxfeed.io.StreamCompression.GZIP = new StreamCompression(CompressionType.Gzip, "gzip", "application/gzip", ".gz")
static

Gzip compression format.

◆ mimeType

string com.dxfeed.io.StreamCompression.mimeType
private

◆ name

string com.dxfeed.io.StreamCompression.name
private

◆ NONE

StreamCompression com.dxfeed.io.StreamCompression.NONE = new StreamCompression(CompressionType.None, "none", "", "")
static

No compression.

◆ type

CompressionType com.dxfeed.io.StreamCompression.type
private

◆ ZIP

StreamCompression com.dxfeed.io.StreamCompression.ZIP = new StreamCompression(CompressionType.Zip, "zip", "application/zip", ".zip")
static

Zip compression format.


The documentation for this class was generated from the following file: