src/Pure/General/bytes.scala
changeset 73576 b50f8cc8c08e
parent 73561 c83152933579
child 75382 81673c441ce3
equal deleted inserted replaced
73575:23d2adc5489e 73576:b50f8cc8c08e
    39       new Bytes(b, 0, b.length)
    39       new Bytes(b, 0, b.length)
    40     }
    40     }
    41 
    41 
    42   val newline: Bytes = apply("\n")
    42   val newline: Bytes = apply("\n")
    43 
    43 
       
    44 
       
    45   /* base64 */
       
    46 
    44   def base64(s: String): Bytes =
    47   def base64(s: String): Bytes =
    45   {
    48   {
    46     val a = Base64.getDecoder.decode(s)
    49     val a = Base64.getDecoder.decode(s)
    47     new Bytes(a, 0, a.length)
    50     new Bytes(a, 0, a.length)
       
    51   }
       
    52 
       
    53   object Decode_Base64 extends Scala.Fun("decode_base64")
       
    54   {
       
    55     val here = Scala_Project.here
       
    56     def invoke(args: List[Bytes]): List[Bytes] =
       
    57       List(base64(Library.the_single(args).text))
       
    58   }
       
    59 
       
    60   object Encode_Base64 extends Scala.Fun("encode_base64")
       
    61   {
       
    62     val here = Scala_Project.here
       
    63     def invoke(args: List[Bytes]): List[Bytes] =
       
    64       List(Bytes(Library.the_single(args).base64))
    48   }
    65   }
    49 
    66 
    50 
    67 
    51   /* read */
    68   /* read */
    52 
    69