Uploaded image for project: 'XNIO'
  1. XNIO
  2. XNIO-120

Handle negative count in Buffer.copy methods

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • api
    • None

      All Buffers.copy methods that receive the parameter count should handle negative count in a similar way negative sliceSizes are handled by slice methods.

      If count is negative, the last -count bytes should be copied from the buffer.

      For example, in the buffer

      {x, y, z, w}

      , a copy request with count -1 should return

      {w}

      result. Similarly, a copy request with count -2 would return

      {z, w}

      , and a copy request with count -3,

      {y, z, w}

      .

            flaviarnn Flavia Rainone
            flaviarnn Flavia Rainone
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: