Class PayloadHelper
Utility methods for encoding payloads.
Inheritance
PayloadHelper
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public static class PayloadHelper
Methods
DecodeInt32(byte[], int)
NOTE: This was decodeInt() in Lucene
Declaration
public static int DecodeInt32(byte[] bytes, int offset)
Parameters
Type |
Name |
Description |
byte[] |
bytes |
|
int |
offset |
|
Returns
DecodeSingle(byte[])
NOTE: This was decodeFloat() in Lucene
Declaration
public static float DecodeSingle(byte[] bytes)
Parameters
Type |
Name |
Description |
byte[] |
bytes |
|
Returns
Type |
Description |
float |
the decoded float
|
See Also
DecodeSingle(byte[], int)
Decode the payload that was encoded using EncodeSingle(float).
NOTE: the length of the array must be at least offset + 4 long.
NOTE: This was decodeFloat() in Lucene
Declaration
public static float DecodeSingle(byte[] bytes, int offset)
Parameters
Type |
Name |
Description |
byte[] |
bytes |
The bytes to decode
|
int |
offset |
The offset into the array.
|
Returns
Type |
Description |
float |
The float that was encoded
|
See Also
EncodeInt32(int)
NOTE: This was encodeInt() in Lucene
Declaration
public static byte[] EncodeInt32(int payload)
Parameters
Type |
Name |
Description |
int |
payload |
|
Returns
EncodeInt32(int, byte[], int)
NOTE: This was encodeInt() in Lucene
Declaration
public static byte[] EncodeInt32(int payload, byte[] data, int offset)
Parameters
Type |
Name |
Description |
int |
payload |
|
byte[] |
data |
|
int |
offset |
|
Returns
EncodeSingle(float)
NOTE: This was encodeFloat() in Lucene
Declaration
public static byte[] EncodeSingle(float payload)
Parameters
Type |
Name |
Description |
float |
payload |
|
Returns
EncodeSingle(float, byte[], int)
NOTE: This was encodeFloat() in Lucene
Declaration
public static byte[] EncodeSingle(float payload, byte[] data, int offset)
Parameters
Returns