Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-926

Replace new byte[] full copes with ByteBufUtil.getBytes

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.1.3
    • None
    • None
    • 1

    Description

      We already do it in some places, but we still got plenty of code which does the equivalent of

      byte[] packet = new byte[response.readableBytes()];
       response.readBytes(packet);
      

      This can be simplified and also made faster (it will call into unsafe code that avoids zeroe-ing out the array using an intrinsic) by using ByteBufUtil.getBytes in netty

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          There are no comments yet on this issue.

          People

            daschl Michael Nitschinger
            daschl Michael Nitschinger
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty