Open In App

Program to convert Java list of bytes to Traversable in Scala

Last Updated : 14 Jan, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
A java list of bytes can be converted to a Traversable collection in Scala by utilizing toTraversable method of Java in Scala. Here, you need to import Scala’s JavaConversions object in order to make this conversions work. Now, lets see some examples and then discuss how it works in details. Example:1#
Output:
Buffer(121, 111, 125)
Example:2#
Output:
Buffer(-122, -126, -100)

Next Article

Similar Reads