| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.android_webview; | 5 package org.chromium.android_webview; |
| 6 | 6 |
| 7 import android.util.Log; | 7 import android.util.Log; |
| 8 | 8 |
| 9 import org.chromium.base.CalledByNative; | 9 import org.chromium.base.annotations.CalledByNative; |
| 10 import org.chromium.base.JNINamespace; | 10 import org.chromium.base.annotations.JNINamespace; |
| 11 | 11 |
| 12 import java.io.IOException; | 12 import java.io.IOException; |
| 13 import java.io.InputStream; | 13 import java.io.InputStream; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * Utility methods for calling InputStream methods. These take care of exception
handling. | 16 * Utility methods for calling InputStream methods. These take care of exception
handling. |
| 17 */ | 17 */ |
| 18 @JNINamespace("android_webview") | 18 @JNINamespace("android_webview") |
| 19 class InputStreamUtil { | 19 class InputStreamUtil { |
| 20 private static final String LOGTAG = "InputStreamUtil"; | 20 private static final String LOGTAG = "InputStreamUtil"; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 @CalledByNative | 61 @CalledByNative |
| 62 public static long skip(InputStream stream, long n) { | 62 public static long skip(InputStream stream, long n) { |
| 63 try { | 63 try { |
| 64 return Math.max(CALL_FAILED_STATUS, stream.skip(n)); | 64 return Math.max(CALL_FAILED_STATUS, stream.skip(n)); |
| 65 } catch (IOException e) { | 65 } catch (IOException e) { |
| 66 Log.e(LOGTAG, logMessage("skip"), e); | 66 Log.e(LOGTAG, logMessage("skip"), e); |
| 67 return EXCEPTION_THROWN_STATUS; | 67 return EXCEPTION_THROWN_STATUS; |
| 68 } | 68 } |
| 69 } | 69 } |
| 70 } | 70 } |
| OLD | NEW |