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
    • Resolution: Fixed
    • Major
    • 2.1.3
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty