=act #17898 Limit length of ByteString.toString
This commit is contained in:
parent
7693f1e5d3
commit
d8ef6b358a
1 changed files with 8 additions and 0 deletions
|
|
@ -409,6 +409,14 @@ sealed abstract class ByteString extends IndexedSeq[Byte] with IndexedSeqOptimiz
|
|||
override def indexWhere(p: Byte ⇒ Boolean): Int = iterator.indexWhere(p)
|
||||
override def indexOf[B >: Byte](elem: B): Int = iterator.indexOf(elem)
|
||||
|
||||
override def toString(): String = {
|
||||
val maxSize = 100
|
||||
if (size > maxSize)
|
||||
take(maxSize).toString + s"... and [${size - maxSize}] more"
|
||||
else
|
||||
super.toString
|
||||
}
|
||||
|
||||
/**
|
||||
* Java API: copy this ByteString into a fresh byte array
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue