ZeroCopy concept written in Scala