Show / Hide Table of Contents

    Class IndexableBinaryStringTools

    Provides support for converting byte sequences to s and back again. The resulting s preserve the original byte sequences' sort order.

    The s are constructed using a Base 8000h encoding of the original binary data - each char of an encoded represents a 15-bit chunk from the byte sequence. Base 8000h was chosen because it allows for all lower 15 bits of char to be used without restriction; the surrogate range [U+D8000-U+DFFF] does not represent valid chars, and would require complicated handling to avoid them and allow use of char's high bit.

    Although unset bits are used as padding in the final char, the original byte sequence could contain trailing bytes with no set bits (null bytes): padding is indistinguishable from valid information. To overcome this problem, a char is appended, indicating the number of encoded bytes in the final content char.

    @lucene.experimental

    Inheritance
    System.Object
    IndexableBinaryStringTools
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class IndexableBinaryStringTools : object

    Methods

    | Improve this Doc View Source

    Decode(Char[], Int32, Int32, Byte[], Int32, Int32)

    Decodes the input sequence into the output sequence. Before calling this method, ensure that the output array has sufficient capacity by calling GetDecodedLength(Char[], Int32, Int32).

    Declaration
    public static void Decode(char[] inputArray, int inputOffset, int inputLength, byte[] outputArray, int outputOffset, int outputLength)
    Parameters
    Type Name Description
    System.Char[] inputArray

    sequence to be decoded

    System.Int32 inputOffset

    Initial offset into inputArray

    System.Int32 inputLength

    Number of chars in inputArray

    System.Byte[] outputArray

    sequence to store encoded result

    System.Int32 outputOffset

    Initial offset into outputArray

    System.Int32 outputLength

    Length of output, must be GetDecodedLength(inputArray, inputOffset, inputLength)

    | Improve this Doc View Source

    Decode(Char[], Int32, Int32, SByte[], Int32, Int32)

    Decodes the input char sequence into the output sbyte sequence. Before calling this method, ensure that the output array has sufficient capacity by calling GetDecodedLength(Char[], Int32, Int32).

    Declaration
    public static void Decode(char[] inputArray, int inputOffset, int inputLength, sbyte[] outputArray, int outputOffset, int outputLength)
    Parameters
    Type Name Description
    System.Char[] inputArray

    sequence to be decoded

    System.Int32 inputOffset

    Initial offset into inputArray

    System.Int32 inputLength

    Number of chars in inputArray

    System.SByte[] outputArray

    sequence to store encoded result

    System.Int32 outputOffset

    Initial offset into outputArray

    System.Int32 outputLength

    Length of output, must be GetDecodedLength(inputArray, inputOffset, inputLength)

    | Improve this Doc View Source

    Encode(Byte[], Int32, Int32, Char[], Int32, Int32)

    Encodes the input sequence into the output char sequence. Before calling this method, ensure that the output array has sufficient capacity by calling GetEncodedLength(Byte[], Int32, Int32).

    Declaration
    public static void Encode(byte[] inputArray, int inputOffset, int inputLength, char[] outputArray, int outputOffset, int outputLength)
    Parameters
    Type Name Description
    System.Byte[] inputArray

    sequence to be encoded

    System.Int32 inputOffset

    Initial offset into inputArray

    System.Int32 inputLength

    Number of bytes in inputArray

    System.Char[] outputArray

    sequence to store encoded result

    System.Int32 outputOffset

    Initial offset into outputArray

    System.Int32 outputLength

    Length of output, must be GetEncodedLength(inputArray, inputOffset, inputLength)

    | Improve this Doc View Source

    Encode(SByte[], Int32, Int32, Char[], Int32, Int32)

    Encodes the input sequence into the output char sequence. Before calling this method, ensure that the output array has sufficient capacity by calling GetEncodedLength(SByte[], Int32, Int32).

    Declaration
    public static void Encode(sbyte[] inputArray, int inputOffset, int inputLength, char[] outputArray, int outputOffset, int outputLength)
    Parameters
    Type Name Description
    System.SByte[] inputArray

    sequence to be encoded

    System.Int32 inputOffset

    Initial offset into inputArray

    System.Int32 inputLength

    Number of bytes in inputArray

    System.Char[] outputArray

    sequence to store encoded result

    System.Int32 outputOffset

    Initial offset into outputArray

    System.Int32 outputLength

    Length of output, must be getEncodedLength

    | Improve this Doc View Source

    GetDecodedLength(Char[], Int32, Int32)

    Returns the number of s required to decode the given char sequence.

    Declaration
    public static int GetDecodedLength(char[] encoded, int offset, int length)
    Parameters
    Type Name Description
    System.Char[] encoded

    Char sequence to be decoded

    System.Int32 offset

    Initial offset

    System.Int32 length

    Number of characters

    Returns
    Type Description
    System.Int32

    The number of s required to decode the given char sequence

    | Improve this Doc View Source

    GetEncodedLength(Byte[], Int32, Int32)

    Returns the number of chars required to encode the given s.

    Declaration
    public static int GetEncodedLength(byte[] inputArray, int inputOffset, int inputLength)
    Parameters
    Type Name Description
    System.Byte[] inputArray

    Byte sequence to be encoded

    System.Int32 inputOffset

    Initial offset into inputArray

    System.Int32 inputLength

    Number of bytes in inputArray

    Returns
    Type Description
    System.Int32

    The number of chars required to encode the number of s.

    | Improve this Doc View Source

    GetEncodedLength(SByte[], Int32, Int32)

    Returns the number of chars required to encode the given s.

    Declaration
    public static int GetEncodedLength(sbyte[] inputArray, int inputOffset, int inputLength)
    Parameters
    Type Name Description
    System.SByte[] inputArray

    sequence to be encoded

    System.Int32 inputOffset

    Initial offset into inputArray

    System.Int32 inputLength

    Number of sbytes in inputArray

    Returns
    Type Description
    System.Int32

    The number of chars required to encode the number of s.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)