List of usage examples for com.google.gwt.typedarrays.shared TypedArrays createArrayBuffer
public static ArrayBuffer createArrayBuffer(int length)
From source file:org.plugination.connect.html.HtmlWebSocket.java
License:Apache License
@Override public void send(ByteBuffer data) { int limit = data.limit(); ArrayBuffer buffer = TypedArrays.createArrayBuffer(limit); Uint8Array arrayBuffer = TypedArrays.createUint8Array(buffer); for (int i = 0; i < limit; i++) { arrayBuffer.set(i, data.get(i)); }//from ww w .ja v a2 s . c o m ws.send(buffer); }