Class PayloadHelper
Utility methods for encoding payloads.
Inheritance
System.Object
PayloadHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Analysis.Payloads
Assembly: Lucene.Net.Analysis.Common.dll
Syntax
public class PayloadHelper
Methods
| Improve this Doc View SourceDecodeInt32(Byte[], Int32)
NOTE: This was decodeInt() in Lucene
Declaration
public static int DecodeInt32(byte[] bytes, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes | |
System.Int32 | offset |
Returns
Type | Description |
---|---|
System.Int32 |
DecodeSingle(Byte[])
NOTE: This was decodeFloat() in Lucene
Declaration
public static float DecodeSingle(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | bytes |
Returns
Type | Description |
---|---|
System.Single | the decoded float |
See Also
| Improve this Doc View SourceDecodeSingle(Byte[], Int32)
Decode the payload that was encoded using EncodeSingle(Single). 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 |
---|---|---|
System.Byte[] | bytes | The bytes to decode |
System.Int32 | offset | The offset into the array. |
Returns
Type | Description |
---|---|
System.Single | The float that was encoded |
See Also
| Improve this Doc View SourceEncodeInt32(Int32)
NOTE: This was encodeInt() in Lucene
Declaration
public static byte[] EncodeInt32(int payload)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | payload |
Returns
Type | Description |
---|---|
System.Byte[] |
EncodeInt32(Int32, Byte[], Int32)
NOTE: This was encodeInt() in Lucene
Declaration
public static byte[] EncodeInt32(int payload, byte[] data, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | payload | |
System.Byte[] | data | |
System.Int32 | offset |
Returns
Type | Description |
---|---|
System.Byte[] |
EncodeSingle(Single)
NOTE: This was encodeFloat() in Lucene
Declaration
public static byte[] EncodeSingle(float payload)
Parameters
Type | Name | Description |
---|---|---|
System.Single | payload |
Returns
Type | Description |
---|---|
System.Byte[] |
EncodeSingle(Single, Byte[], Int32)
NOTE: This was encodeFloat() in Lucene
Declaration
public static byte[] EncodeSingle(float payload, byte[] data, int offset)
Parameters
Type | Name | Description |
---|---|---|
System.Single | payload | |
System.Byte[] | data | |
System.Int32 | offset |
Returns
Type | Description |
---|---|
System.Byte[] |