-#15825 add isEmpty and nonEmpty to ByteStringBuilder
This commit is contained in:
parent
213a5a4300
commit
954a86bf80
2 changed files with 24 additions and 0 deletions
|
|
@ -789,4 +789,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