Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endsWith and startsWith methods to Bytes #823

Closed
keith-turner opened this issue Apr 18, 2017 · 0 comments
Closed

Add endsWith and startsWith methods to Bytes #823

keith-turner opened this issue Apr 18, 2017 · 0 comments
Milestone

Comments

@keith-turner
Copy link
Contributor

keith-turner commented Apr 18, 2017

Multiple times I have run into situations where I wanted to know if Bytes started with a certain prefix. It would be useful to have methods on Bytes to for check this like String has. Something like :

  • boolean Bytes.startsWith(Bytes prefix)
  • boolean Bytes.endsWith(Bytes suffix).
cjmctague added a commit to cjmctague/fluo that referenced this issue Apr 22, 2017
-added startsWith(Byte prefix) method to Bytes.java
-added endsWith(Bytes prefix) method to Bytes.java
-added testPrefixSuffix() method to BytesTest.java
cjmctague added a commit to cjmctague/fluo that referenced this issue Apr 22, 2017
-added startsWith(Byte prefix) method to Bytes.java
-added endsWith(Bytes suffix) method to Bytes.java
-added testPrefixSuffix() method to BytesTest.java
cjmctague added a commit to cjmctague/fluo that referenced this issue Apr 25, 2017
-Added suggested changes
-Added more unit tests
cjmctague added a commit to cjmctague/fluo that referenced this issue Apr 26, 2017
-Avoid repeatedly adding offsets
@asfgit asfgit closed this as completed in 38dc66d Apr 26, 2017
@mikewalch mikewalch added this to the 1.1.0 milestone May 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants