Merge pull request #17086 from hepin1989/master
#15825 add isEmpty and nonEmpty to ByteStringBuilder
This commit is contained in:
commit
faefc32237
2 changed files with 24 additions and 0 deletions
|
|
@ -798,4 +798,14 @@ final class ByteStringBuilder extends Builder[Byte, ByteString] {
|
|||
|
||||
override def write(b: Array[Byte], off: Int, len: Int): Unit = { builder.putBytes(b, off, len) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether this ByteStringBuilder is empty.
|
||||
*/
|
||||
def isEmpty: Boolean = _length == 0
|
||||
|
||||
/**
|
||||
* Tests whether this ByteStringBuilder is not empty.
|
||||
*/
|
||||
def nonEmpty: Boolean = _length > 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue