当前位置: 首页>>代码示例>>C#>>正文


C# Lucene.Net.Store.IndexOutput.WriteByte方法代码示例

本文整理汇总了C#中Lucene.Net.Store.IndexOutput.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# Lucene.Net.Store.IndexOutput.WriteByte方法的具体用法?C# Lucene.Net.Store.IndexOutput.WriteByte怎么用?C# Lucene.Net.Store.IndexOutput.WriteByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lucene.Net.Store.IndexOutput的用法示例。


在下文中一共展示了Lucene.Net.Store.IndexOutput.WriteByte方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteDgaps

 /// <summary>Write as a d-gaps list </summary>
 private void WriteDgaps(IndexOutput output)
 {
     output.WriteInt(- 1); // mark using d-gaps
     output.WriteInt(Size()); // write size
     output.WriteInt(Count()); // write count
     int last = 0;
     int n = Count();
     int m = bits.Length;
     for (int i = 0; i < m && n > 0; i++)
     {
         if (bits[i] != 0)
         {
             output.WriteVInt(i - last);
             output.WriteByte(bits[i]);
             last = i;
             n -= BYTE_COUNTS[bits[i] & 0xFF];
         }
     }
 }
开发者ID:cqm0609,项目名称:lucene-file-finder,代码行数:20,代码来源:BitVector.cs

示例2: Write

		public void  Write(IndexOutput output)
		{
			output.WriteVInt(CURRENT_FORMAT);
			output.WriteVInt(Size());
			for (int i = 0; i < Size(); i++)
			{
				FieldInfo fi = FieldInfo(i);
				byte bits = (byte) (0x0);
				if (fi.isIndexed)
					bits |= IS_INDEXED;
				if (fi.storeTermVector)
					bits |= STORE_TERMVECTOR;
				if (fi.storePositionWithTermVector)
					bits |= STORE_POSITIONS_WITH_TERMVECTOR;
				if (fi.storeOffsetWithTermVector)
					bits |= STORE_OFFSET_WITH_TERMVECTOR;
				if (fi.omitNorms)
					bits |= OMIT_NORMS;
				if (fi.storePayloads)
					bits |= STORE_PAYLOADS;
				if (fi.omitTermFreqAndPositions)
					bits |= OMIT_TERM_FREQ_AND_POSITIONS;
				
				output.WriteString(fi.name);
				output.WriteByte(bits);
			}
		}
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:27,代码来源:FieldInfos.cs

示例3: Write

		/// <summary> Save this segment's info.</summary>
		internal void  Write(IndexOutput output)
		{
			output.WriteString(name);
			output.WriteInt(docCount);
			output.WriteLong(delGen);
			output.WriteByte((byte) (hasSingleNormFile ? 1 : 0));
			if (normGen == null)
			{
				output.WriteInt(- 1);
			}
			else
			{
				output.WriteInt(normGen.Length);
				for (int j = 0; j < normGen.Length; j++)
				{
					output.WriteLong(normGen[j]);
				}
			}
			output.WriteByte((byte) isCompoundFile);
		}
开发者ID:zweib730,项目名称:beagrep,代码行数:21,代码来源:SegmentInfo.cs

示例4: Write

		/// <summary> Save this segment's info.</summary>
		internal void  Write(IndexOutput output)
		{
			output.WriteString(name);
			output.WriteInt(docCount);
			output.WriteLong(delGen);
			output.WriteInt(docStoreOffset);
			if (docStoreOffset != - 1)
			{
				output.WriteString(docStoreSegment);
				output.WriteByte((byte) (docStoreIsCompoundFile?1:0));
			}
			
			output.WriteByte((byte) (hasSingleNormFile?1:0));
			if (normGen == null)
			{
				output.WriteInt(NO);
			}
			else
			{
				output.WriteInt(normGen.Length);
				for (int j = 0; j < normGen.Length; j++)
				{
					output.WriteLong(normGen[j]);
				}
			}
			output.WriteByte((byte) isCompoundFile);
			output.WriteInt(delCount);
			output.WriteByte((byte) (hasProx?1:0));
			output.WriteStringStringMap(diagnostics);
		}
开发者ID:Rationalle,项目名称:ravendb,代码行数:31,代码来源:SegmentInfo.cs

示例5: FillBytes

		/* Used only when writing norms to fill in default norm
		* value into the holes in docID stream for those docs
		* that didn't have this field. */
		internal static void  FillBytes(IndexOutput out_Renamed, byte b, int numBytes)
		{
			for (int i = 0; i < numBytes; i++)
				out_Renamed.WriteByte(b);
		}
开发者ID:vikasraz,项目名称:indexsearchutils,代码行数:8,代码来源:DocumentsWriter.cs

示例6: AddVarIntsField

        private void AddVarIntsField(FieldInfo field, IndexOutput output, IEnumerable<long?> values, long minValue, long maxValue)
        {
            field.PutAttribute(LegacyKey, LegacyDocValuesType.VAR_INTS.Name);

            CodecUtil.WriteHeader(output, Lucene40DocValuesFormat.VAR_INTS_CODEC_NAME, Lucene40DocValuesFormat.VAR_INTS_VERSION_CURRENT);

            long delta = maxValue - minValue;

            if (delta < 0)
            {
                // writes longs
                output.WriteByte((byte)Lucene40DocValuesFormat.VAR_INTS_FIXED_64);
                foreach (long? n in values)
                {
                    output.WriteLong(n == null ? 0 : n.Value);
                }
            }
            else
            {
                // writes packed ints
                output.WriteByte((byte)Lucene40DocValuesFormat.VAR_INTS_PACKED);
                output.WriteLong(minValue);
                output.WriteLong(0 - minValue); // default value (representation of 0)
                PackedInts.Writer writer = PackedInts.GetWriter(output, State.SegmentInfo.DocCount, PackedInts.BitsRequired(delta), PackedInts.DEFAULT);
                foreach (long? n in values)
                {
                    long v = n == null ? 0 : (long)n;
                    writer.Add(v - minValue);
                }
                writer.Finish();
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:32,代码来源:Lucene40DocValuesWriter.cs

示例7: AddBytesField

 private void AddBytesField(FieldInfo field, IndexOutput output, IEnumerable<long?> values)
 {
     field.PutAttribute(LegacyKey, LegacyDocValuesType.FIXED_INTS_8.Name);
     CodecUtil.WriteHeader(output, Lucene40DocValuesFormat.INTS_CODEC_NAME, Lucene40DocValuesFormat.INTS_VERSION_CURRENT);
     output.WriteInt(1); // size
     foreach (long? n in values)
     {
         output.WriteByte(n == null ? (byte)0 : (byte)n);
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:Lucene40DocValuesWriter.cs

示例8: WriteVShort

 // the little vint encoding used for var-deref
 private static void WriteVShort(IndexOutput o, int i)
 {
     Debug.Assert(i >= 0 && i <= short.MaxValue);
     if (i < 128)
     {
         o.WriteByte((byte)(sbyte)i);
     }
     else
     {
         o.WriteByte((byte)unchecked((sbyte)(0x80 | (i >> 8))));
         o.WriteByte((byte)unchecked((sbyte)(i & 0xff)));
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:14,代码来源:Lucene40DocValuesWriter.cs

示例9: WriteClearedDgaps

 /// <summary>
 /// Write as a d-gaps list </summary>
 private void WriteClearedDgaps(IndexOutput output)
 {
     output.WriteInt(-1); // mark using d-gaps
     output.WriteInt(Size()); // write size
     output.WriteInt(Count()); // write count
     int last = 0;
     int numCleared = Size() - Count();
     for (int i = 0; i < Bits.Length && numCleared > 0; i++)
     {
         if (Bits[i] != unchecked((byte)0xff))
         {
             output.WriteVInt(i - last);
             output.WriteByte(Bits[i]);
             last = i;
             numCleared -= (8 - BitUtil.BitCount(Bits[i]));
             Debug.Assert(numCleared >= 0 || (i == (Bits.Length - 1) && numCleared == -(8 - (Size_Renamed & 7))));
         }
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:21,代码来源:BitVector.cs


注:本文中的Lucene.Net.Store.IndexOutput.WriteByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。