PlainText.scala 415 B

12345678910111213141516171819202122232425262728
  1. package com.ibm.techempower
  2. import java.nio.ByteBuffer
  3. import com.ibm.plain.rest.Resource
  4. import com.ibm.plain.text.`UTF-8`
  5. final class PlainText
  6. extends Resource {
  7. import PlainText._
  8. Get { hello.duplicate }
  9. }
  10. object PlainText {
  11. private final val hello = {
  12. val a = "Hello, World!".getBytes(`UTF-8`)
  13. val buf = ByteBuffer.allocateDirect(a.length)
  14. buf.put(a)
  15. buf.flip
  16. buf
  17. }
  18. }