Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8303644

Add method for counting leading non-negative bytes in byte arrays

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • None

      Internally we've implemented the package private method java.lang.StringCoding.countPositives for efficiently counting positive bytes in a byte array. This has been developed and deployed to support the needs of built-in charset encoders/decoders, where counting positives is a quick ASCII test. It appears there's utility for such a method elsewhere - not the least in non-builtin decoders and encoders - so we should consider exposing this as a public API.

      Suggestion to add a public method to java.util.Arrays, delegating when appropriate to the internal method in java.lang.StringCoding

            Unassigned Unassigned
            redestad Claes Redestad
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: