Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def onPartReceived(partSize: Int) = {
- this.synchronized {
- currentSize += partSize
- val newIndex = currentSize / bytesPerLine - 1
- try {
- if (newIndex >= index) {
- for (i <- index to newIndex) {
- bus post ErrorEvent("art.size = %d, index = %d, newIndex = %d", art.size, index, newIndex)
- bus post InfoEvent(art(index))
- index += 1
- }
- }
- } catch {
- case e: IndexOutOfBoundsException => bus post ErrorEvent("Array Out Of: art.size = %d, index = %d, newIndex = %d", art.size, index, newIndex)
- case e: Throwable => bus post ErrorEvent("Exception %s, cause %s", e.getMessage, e.toString)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement