android WebSocket 发送图片

 

分片发:

https://github.com/aletor92/WebSocketServerImageShare

   WebSocketUtil.getInstance().broadcastMessage("start");
                while(counter < base64Length){
                    WebSocketUtil.getInstance().broadcastMessage(
                            encodedString.substring(counter,
                                    (counter + 10000) > base64Length ?
                                            base64Length :
                                            (counter + 10000)
                            )
                    );
                    counter += 10000;
                }
                WebSocketUtil.getInstance().broadcastMessage("end");
            }

 

https://github.com/onozaty/shared-camera-websocket

组件:

import org.springframework.stereotype.Component;
import org.springframework.web.socket.BinaryMessage;
import org.springframework.web.socket.CloseStatus;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.handler.BinaryWebSocketHandler;

 

你可能感兴趣的:(android开发)