Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-2365

ByteBufferUtil.read(byte[]) returns 0 when the end of the stream has been reached.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 0.7.5
    • Component/s: None
    • Labels:
      None
    • Severity:
      Low

      Description

      read(byte[], int, int) doesn't return -1 when the end of the stream is reached. Instead, it returns 0.

      len = Math.min(len, copy.remaining());
      copy.get(bytes, off, len);

      return len;

      copy.remaining() returns 0 when the end of the stream is reached.

        Attachments

        1. 2365.txt
          0.6 kB
          Jonathan Ellis

          Activity

            People

            • Assignee:
              jbellis Jonathan Ellis
              Reporter:
              julie.zhang10 Yewei Zhang
              Authors:
              Jonathan Ellis
              Reviewers:
              Sylvain Lebresne
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: