本文整理了Java中com.google.gwt.xhr.client.XMLHttpRequest.getResponseArrayBuffer()
方法的一些代码示例,展示了XMLHttpRequest.getResponseArrayBuffer()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLHttpRequest.getResponseArrayBuffer()
方法的具体详情如下:
包路径:com.google.gwt.xhr.client.XMLHttpRequest
类名称:XMLHttpRequest
方法名:getResponseArrayBuffer
[英]Get the response as an ArrayBuffer.
[中]作为ArrayBuffer获取响应。
代码示例来源:origin: libgdx/libgdx
@Override
public void onReadyStateChange (XMLHttpRequest xhr) {
if (xhr.getReadyState() == XMLHttpRequest.DONE) {
if (xhr.getStatus() != 200) {
listener.onFailure();
} else {
Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
listener.onSuccess(new Blob(data));
}
}
}
});
代码示例来源:origin: libgdx/libgdx
@Override
public void onReadyStateChange (XMLHttpRequest xhr) {
if (xhr.getReadyState() == XMLHttpRequest.DONE) {
if (xhr.getStatus() != 200) {
listener.onFailure();
} else {
Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
listener.onSuccess(new Blob(data));
}
}
}
});
代码示例来源:origin: io.playn/playn-html
public ByteBuffer apply (XMLHttpRequest xhr) {
return TypedArrayHelper.wrap(xhr.getResponseArrayBuffer());
}
});
代码示例来源:origin: playn/playn
public ByteBuffer apply (XMLHttpRequest xhr) {
return TypedArrayHelper.wrap(xhr.getResponseArrayBuffer());
}
});
代码示例来源:origin: thothbot/parallax
@Override
public void onReadyStateChange (XMLHttpRequest xhr) {
if (xhr.getReadyState() == XMLHttpRequest.DONE) {
if (xhr.getStatus() != 200) {
listener.onFailure();
} else {
Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
listener.onSuccess(new Blob(data));
}
}
}
});
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt
@Override
public void onReadyStateChange (XMLHttpRequest xhr) {
if (xhr.getReadyState() == XMLHttpRequest.DONE) {
if (xhr.getStatus() != 200) {
listener.onFailure();
} else {
Int8Array data = TypedArrays.createInt8Array(xhr.getResponseArrayBuffer());
listener.onSuccess(new Blob(data));
}
}
}
});
代码示例来源:origin: sriharshachilakapati/SilenceEngine
@Override
public void readBinaryFile(FilePath file, UniCallback<DirectBuffer> onComplete, UniCallback<Throwable> onError)
{
// Create a XMLHttpRequest to load the file into a direct buffer
XMLHttpRequest request = XMLHttpRequest.create();
request.open("GET", file.getAbsolutePath());
// Set to read as ArrayBuffer and attach a handler
request.setResponseType(XMLHttpRequest.ResponseType.ArrayBuffer);
request.setOnReadyStateChange(xhr ->
{
if (request.getReadyState() == XMLHttpRequest.DONE)
{
if (request.getStatus() == 200)
// Invoke the onComplete handler
onComplete.invoke(new GwtDirectBuffer(request.getResponseArrayBuffer()));
else
onError.invoke(new SilenceException("Error fetching the file: " + request.getStatusText()));
}
});
// Send the request
request.send();
}
内容来源于网络,如有侵权,请联系作者删除!