public override BytesRef Encode(char[] buffer, int offset, int length) { int payload = ArrayUtil.ParseInt32(buffer, offset, length); //TODO: improve this so that we don't have to new Strings byte[] bytes = PayloadHelper.EncodeInt32(payload); BytesRef result = new BytesRef(bytes); return(result); }
public override sealed bool IncrementToken() { if (m_input.IncrementToken()) { byte[] data = new byte[8]; PayloadHelper.EncodeInt32(offsetAtt.StartOffset, data, 0); PayloadHelper.EncodeInt32(offsetAtt.EndOffset, data, 4); BytesRef payload = new BytesRef(data); payAtt.Payload = payload; return(true); } else { return(false); } }