有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

对等端重置java Google Drive SDk连接

我使用以下代码将公共共享图像从google drive加载到安卓应用程序,但有时我会得到:

javax.net.ssl.SSLException: Read error: ssl=0x1d9ed0: I/O error during system call, Connection reset by peer

为什么谷歌硬盘在我下载图片之前关闭了连接?这是随机发生的,但非常频繁。有人与这样的问题发生冲突吗

public static InputStream getStream(String url)
{

    InputStream is = null;
    try
    {
        is = new URL(url).openConnection().getInputStream();
    } catch (MalformedURLException e)
    {
        L.e(e.toString());
    } catch (IOException e)
    {
        L.e(e.toString());
    }

    return is;
}

对于位图加载,我使用简单的代码:

BitmapFactory.decodeStream(stream, null, null);

共 (0) 个答案