本文整理匯總了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;
}