Class IndexableBinaryStringTools
Provides support for converting byte sequences to
The
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
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public sealed class IndexableBinaryStringTools : object
Methods
| Improve this Doc View SourceDecode(Char[], Int32, Int32, Byte[], Int32, Int32)
Decodes the input
Declaration
public static void Decode(char[] inputArray, int inputOffset, int inputLength, byte[] outputArray, int outputOffset, int outputLength)
Parameters
Type | Name | Description |
---|---|---|
System. |
inputArray | |
System. |
inputOffset | Initial offset into |
System. |
inputLength | Number of chars in |
System. |
outputArray | |
System. |
outputOffset | Initial offset into outputArray |
System. |
outputLength | Length of output, must be GetDecodedLength(inputArray, inputOffset, inputLength) |
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 Get
Declaration
public static void Decode(char[] inputArray, int inputOffset, int inputLength, sbyte[] outputArray, int outputOffset, int outputLength)
Parameters
Type | Name | Description |
---|---|---|
System. |
inputArray | |
System. |
inputOffset | Initial offset into |
System. |
inputLength | Number of chars in |
System. |
outputArray | |
System. |
outputOffset | Initial offset into outputArray |
System. |
outputLength | Length of output, must be GetDecodedLength(inputArray, inputOffset, inputLength) |
Encode(Byte[], Int32, Int32, Char[], Int32, Int32)
Encodes the input
Declaration
public static void Encode(byte[] inputArray, int inputOffset, int inputLength, char[] outputArray, int outputOffset, int outputLength)
Parameters
Type | Name | Description |
---|---|---|
System. |
inputArray | |
System. |
inputOffset | Initial offset into |
System. |
inputLength | Number of bytes in |
System. |
outputArray | |
System. |
outputOffset | Initial offset into outputArray |
System. |
outputLength | Length of output, must be GetEncodedLength(inputArray, inputOffset, inputLength) |
Encode(SByte[], Int32, Int32, Char[], Int32, Int32)
Encodes the input
Declaration
public static void Encode(sbyte[] inputArray, int inputOffset, int inputLength, char[] outputArray, int outputOffset, int outputLength)
Parameters
Type | Name | Description |
---|---|---|
System. |
inputArray | |
System. |
inputOffset | Initial offset into |
System. |
inputLength | Number of bytes in |
System. |
outputArray | |
System. |
outputOffset | Initial offset into outputArray |
System. |
outputLength | Length of output, must be getEncodedLength |
GetDecodedLength(Char[], Int32, Int32)
Returns the number of
Declaration
public static int GetDecodedLength(char[] encoded, int offset, int length)
Parameters
Type | Name | Description |
---|---|---|
System. |
encoded | Char sequence to be decoded |
System. |
offset | Initial offset |
System. |
length | Number of characters |
Returns
Type | Description |
---|---|
System. |
The number of |
GetEncodedLength(Byte[], Int32, Int32)
Returns the number of chars required to encode the given
Declaration
public static int GetEncodedLength(byte[] inputArray, int inputOffset, int inputLength)
Parameters
Type | Name | Description |
---|---|---|
System. |
inputArray | Byte sequence to be encoded |
System. |
inputOffset | Initial offset into |
System. |
inputLength | Number of bytes in |
Returns
Type | Description |
---|---|
System. |
The number of chars required to encode the number of |
GetEncodedLength(SByte[], Int32, Int32)
Returns the number of chars required to encode the given
Declaration
public static int GetEncodedLength(sbyte[] inputArray, int inputOffset, int inputLength)
Parameters
Type | Name | Description |
---|---|---|
System. |
inputArray | |
System. |
inputOffset | Initial offset into |
System. |
inputLength | Number of sbytes in |
Returns
Type | Description |
---|---|
System. |
The number of chars required to encode the number of |