SkImageDecoder::Factory returned nullcom.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()}
}
}
添加回答
举报
0/150
提交
取消