Merge pull request #17086 from hepin1989/master

#15825 add isEmpty and nonEmpty to ByteStringBuilder
This commit is contained in:
Konrad Malawski 2015-04-02 10:57:47 +02:00
commit faefc32237
2 changed files with 24 additions and 0 deletions

View file

@ -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
}