本文整理汇总了Java中android.support.v4.media.session.PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM属性的典型用法代码示例。如果您正苦于以下问题:Java PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM属性的具体用法?Java PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM怎么用?Java PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.support.v4.media.session.PlaybackStateCompat
的用法示例。
在下文中一共展示了PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getResponseData
byte[] getResponseData(HttpEntity entity) throws IOException {
byte[] responseBody = null;
if (entity != null) {
InputStream instream = entity.getContent();
if (instream != null) {
long contentLength = entity.getContentLength();
if (contentLength > 2147483647L) {
throw new IllegalArgumentException("HTTP entity too large to be buffered in " +
"memory");
}
if (contentLength < 0) {
contentLength = PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM;
}
try {
ByteArrayBuffer buffer = new ByteArrayBuffer((int) contentLength);
byte[] tmp = new byte[4096];
while (true) {
int l = instream.read(tmp);
if (l == -1 || Thread.currentThread().isInterrupted()) {
break;
}
buffer.append(tmp, 0, l);
sendProgressDataMessage(copyOfRange(tmp, 0, l));
sendProgressMessage((long) 0, contentLength);
}
AsyncHttpClient.silentCloseInputStream(instream);
responseBody = buffer.toByteArray();
} catch (OutOfMemoryError e) {
System.gc();
throw new IOException("File too large to fit into available memory");
} catch (Throwable th) {
AsyncHttpClient.silentCloseInputStream(instream);
}
}
}
return responseBody;
}