Support direct comparisons between byte[] and Bytes
See original GitHub issueWhen comparing byte[] and Bytes, this currently requires an allocation and a copy. It would be nice to be able to do direct comparisons. To avoid copy+allocation, could possibly add the following methods to Bytes.
class Bytes {
//note the method name contentEquals is used in String for types other than String
public boolean contentEquals(byte[] bytes){...}
public boolean contentEquals(byte[] bytes, int offset, int len){...}
public int compareTo(byte[] bytes){...}
public int compareTo(byte[] bytes, int offset, int len){...}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
When bandwidth and storage size matters: Bits vs. bytes
So, bits and bytes are both units of data, but what is the actual difference between them? One byte is equivalent to eight...
Read more >What's the Difference Between a Word and a Byte? - Baeldung
Learn the characteristics of words and bytes and discussed their different relationships with memory and processors.
Read more >Directly compare Two 8 Bit (1 Byte) values in C++
I'm wondering, is there a way to compare 8 bit values similarly to the way that we could compare an int? Yes, there...
Read more >Understanding Bits and Bytes - Sewell Direct
A Byte is a collection of 8 bits; As you get into larger numbers of bits and bytes you start using prefixes, like...
Read more >SmileDirectClub vs. Byte: An Honest Comparison - Smile Prep
Appearance Comparison. Both Byte and SmileDirectClub provide clear aligners that fit the contours of your teeth and are much less visible than ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jkosh44 you need to fork the apache repo, push your changes to your fork, and then create a pull request. You are trying to push to the apache repo instead of your forked repo. If you have already forked look into the
git remote add
command. Also look into pushing to specific remote.https://help.github.com/articles/fork-a-repo/ https://help.github.com/articles/about-pull-requests/
Thanks, I missed that step. I made my fork, pushed my code, and a created pull request.