WriteBytes() 공개 메소드

public WriteBytes ( byte b, int length ) : void
b byte
length int
리턴 void
예제 #1
0
        /// <summary>
        /// Copy the current contents of this buffer to the named output. </summary>
        public virtual void WriteTo(DataOutput @out)
        {
            Flush();
            long end    = file.length;
            long pos    = 0;
            int  buffer = 0;

            while (pos < end)
            {
                int  length  = BUFFER_SIZE;
                long nextPos = pos + length;
                if (nextPos > end) // at the last buffer
                {
                    length = (int)(end - pos);
                }
                @out.WriteBytes(file.GetBuffer(buffer++), length);
                pos = nextPos;
            }
        }
예제 #2
0
 /// <summary>
 /// Copy the current contents of this buffer to the named output. </summary>
 public virtual void WriteTo(DataOutput @out)
 {
     Flush();
     long end = File.Length_Renamed;
     long pos = 0;
     int buffer = 0;
     while (pos < end)
     {
         int length = BUFFER_SIZE;
         long nextPos = pos + length;
         if (nextPos > end) // at the last buffer
         {
             length = (int)(end - pos);
         }
         @out.WriteBytes(File.GetBuffer(buffer++), length);
         pos = nextPos;
     }
 }
예제 #3
0
 public override void EncodeTerm(long[] empty, DataOutput output, FieldInfo fieldInfo, BlockTermState _state,
     bool absolute)
 {
     PulsingTermState state = (PulsingTermState) _state;
     Debug.Debug.Assert((empty.Length == 0);
     this.absolute = this.absolute || absolute;
     if (state.bytes == null)
     {
         _wrappedPostingsWriter.EncodeTerm(longs, buffer, fieldInfo, state.wrappedState, this.absolute);
         for (int i = 0; i < longsSize; i++)
         {
             output.WriteVLong(longs[i]);
         }
         buffer.WriteTo(output);
         buffer.Reset();
         this.absolute = false;
     }
     else
     {
         output.WriteVInt(state.bytes.Length);
         output.WriteBytes(state.bytes, 0, state.bytes.Length);
         this.absolute = this.absolute || absolute;
     }
 }