code: public void addDouble(double value) {
          data[endOffset] = value;
          endOffset++;
          
          // Grow the buffer if needed
          if (endOffset == data.length && !reachedMax)
              resize();
          
          // Loop over and advance the start point if needed
          if (endOffset == data.length) {
              endOffset = 0;
          }
          if (endOffset == startOffset)
              startOffset++;
          if (startOffset == data.length)
              startOffset = 0;
      }
docs: Adds a new value.
  
  @param value new value