Meshbeyn / Projects

Namespace FastBWT

public abstract void ADesorter.Desort

This method desorts source block and saves the desorted bytes to target block.

Syntax

public abstract byte[] Desort(
    byte[] SourceBlock,
    long StartIndex,
    byte[] TargetBlock,
    long DataSize = 0
)

Parameters

byte[] SourceBlock

Array with source bytes.

long StartIndex

BWT starting index

byte[] TargetBlock = null

Array for sorted bytes. If you specify null, the new array will be created.

long DataSize

Source data length. If source block is not filled completely, set the amount of source bytes using this parameter. Default value 0 means DataSize = SourceBlock.length.

Return value

Array with desorted bytes. This is TargetBlock or a new array if the TargetBlock is not specified.

Exceptions

IndexOutOfRangeException

This exception is thrown if DataSize is too big or if the TargetBlock is too small.

OutOfMemoryException

This exception is thrown if the desorter needs more memory than the system has or if you try to desort a too big source array with the desorter, that doesn't support this. You may try to use a system with more (virtual) memory or use other desorter.

Remarks

This method desorts SourceBlock to TargetBlock. You may use this method if you need to desort only one block. To desort multiple blocks, consider to use methods GenerateVector and FillDesortedBlock. Method Desort creates new array for desorting vector and discards it after using. If you need to desort multiple blocks, this strategy is not optimal.

The capabilities and memory usage of method Desort depend on concrete implementation. Read the description of concrete Desorter classes for this information.

Example

static byte[] DesortBytes(byte[] Source, long Idx)
{
    ADesorter UnBWT = new BWT_Small_Desorter();
    return UnBWT.Desort(Source, Idx);
}

See also

BWT_Small_Desorter class

ADesorter class

Project FastBWT