本文整理汇总了Golang中github.com/balzaczyy/golucene/store.IndexInput.ReadLong方法的典型用法代码示例。如果您正苦于以下问题:Golang IndexInput.ReadLong方法的具体用法?Golang IndexInput.ReadLong怎么用?Golang IndexInput.ReadLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/balzaczyy/golucene/store.IndexInput
的用法示例。
在下文中一共展示了IndexInput.ReadLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: seekDir
func (r *BlockTreeTermsReader) seekDir(input store.IndexInput, dirOffset int64) (err error) {
log.Printf("Seeking to: %v", dirOffset)
if r.version >= BTT_INDEX_VERSION_APPEND_ONLY {
input.Seek(input.Length() - 8)
if dirOffset, err = input.ReadLong(); err != nil {
return err
}
}
input.Seek(dirOffset)
return nil
}
示例2: readIndexHeader
func (r *BlockTreeTermsReader) readIndexHeader(input store.IndexInput) (version int, err error) {
version, err = asInt(codec.CheckHeader(input, BTT_INDEX_CODEC_NAME, BTT_INDEX_VERSION_START, BTT_INDEX_VERSION_CURRENT))
if err != nil {
return version, err
}
if version < BTT_INDEX_VERSION_APPEND_ONLY {
r.indexDirOffset, err = input.ReadLong()
if err != nil {
return version, err
}
}
return version, nil
}
示例3: readFields
/*
Lucene42DocValuesProducer.java
Line 126
*/
func (dvp *Lucene42DocValuesProducer) readFields(meta store.IndexInput, infos FieldInfos) (err error) {
fieldNumber, err := meta.ReadVInt()
for fieldNumber != -1 && err == nil {
fieldType, err := meta.ReadByte()
if err != nil {
break
}
switch fieldType {
case LUCENE42_DV_NUMBER:
entry := NumericEntry{}
entry.offset, err = meta.ReadLong()
if err != nil {
return err
}
entry.format, err = meta.ReadByte()
if err != nil {
return err
}
switch entry.format {
case LUCENE42_DV_DELTA_COMPRESSED:
case LUCENE42_DV_TABLE_COMPRESSED:
case LUCENE42_DV_GCD_COMPRESSED:
case LUCENE42_DV_UNCOMPRESSED:
default:
return errors.New(fmt.Sprintf("Unknown format: %v, input=%v", entry.format, meta))
}
if entry.format != LUCENE42_DV_UNCOMPRESSED {
n, err := meta.ReadVInt()
if err != nil {
return err
}
entry.packedIntsVersion = int(n)
}
case LUCENE42_DV_BYTES:
panic("not implemented yet")
case LUCENE42_DV_FST:
panic("not implemented yet")
default:
return errors.New(fmt.Sprintf("invalid entry type: %v, input=%v", fieldType, meta))
}
fieldNumber, err = meta.ReadVInt()
}
return err
}