Dim bc As ByteConverter
Dim tp As InputStream = File.OpenInput(File.DirAssets,"myspecial.jpg")
resp.ContentType = "image/jpeg"
Dim buffer(tp.BytesAvailable) As Byte
Dim count As Int = tp.ReadBytes(buffer,0,buffer.Length)
If count <> -1 Then
' save as a file to verify we read the correct data
Dim fo As OutputStream = File.OpenOutput("/","test.jpg",False)
fo.WriteBytes(buffer,0,count)
fo.Close
' one of many tries to send binary data
Dim bc As ByteConverter
Dim s As String = bc.StringFromBytes(buffer,"UTF-8")
Log(count & "," & s.Length)
Dim a As Int
resp.Write(s)
End If
tp.close