猿问

图片读取压缩显示问题

SkImageDecoder::Factory returned null

com.example.administrator.image1android.graphics.Bitmapandroid.graphics.BitmapFactoryandroid.os.Environmentandroid.os.Handlerandroid.os.Looperandroid.os.Messagejava.io.ByteArrayOutputStreamjava.io.DataInputStreamjava.io.DataOutputStreamjava.io.Filejava.io.FileInputStreamjava.io.IOExceptionjava.net.SocketClientThread Runnable {
    Socket Handler Handler DataInputStream DataOutputStream Bitmap String Handler = Handler(){
        (Message msg) {
            (msg.== ){


                File file1 = File()(!file1.exists()) {
                    file1.mkdirs()}

                File file = File(Environment.())(file.exists()){
                    = file.getAbsolutePath()}
                FileInputStream fileInputStream = {
                    =  DataOutputStream(.getOutputStream())fileInputStream = FileInputStream(file)len = fileInputStream.available()System..print(len)[] bytes = [len]bytes1 = fileInputStream.read(bytes).write(bytesbytes1)} (IOException e) {
                    e.printStackTrace()}
            }
        }
    }ClientThread(Handler handler){
        .= handler}

    () {
            {
                = Socket()= DataInputStream(.getInputStream())Thread(){
                    () {
                        size {

                            size = .readInt()[] data = [size]len = (len < size) {
                                len += .read(datalensize - len)}

                            ByteArrayOutputStream outPut = ByteArrayOutputStream()= BitmapFactory.().compress(Bitmap.CompressFormat.outPut)Message message = Message()message.= message.= .sendMessage(message)} (IOException e) {
                            e.printStackTrace()System..println(e.toString() + )}

                    }
                }.start()Looper.()= Handler(){

                    (Message msg) {

                        (msg.== ){
                           Message message = Message()message.= .sendMessage(message)}
                    }
                }Looper.()}(Exception e){
                e.printStackTrace()}

    }
}


金鱼记忆
浏览 1284回答 1
1回答

Frank作家

java 的吗?  
随时随地看视频慕课网APP

相关分类

Android
Java
我要回答