本文整理了Java中java.net.URLConnection.getHeaderFieldLong()
方法的一些代码示例,展示了URLConnection.getHeaderFieldLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。URLConnection.getHeaderFieldLong()
方法的具体详情如下:
包路径:java.net.URLConnection
类名称:URLConnection
方法名:getHeaderFieldLong
[英]Returns the value of the named field parsed as a number.
This form of getHeaderField
exists because some connection types (e.g., http-ng
) have pre-parsed headers. Classes for that connection type can override this method and short-circuit the parsing.
[中]返回解析为数字的命名字段的值。
这种形式的getHeaderField
之所以存在,是因为某些连接类型(例如http-ng
)具有预解析的头。该连接类型的类可以重写此方法并缩短解析过程。
代码示例来源:origin: org.apidesign.bck2brwsr/emul
/**
* Returns the value of the <code>content-length</code> header field as a
* long.
*
* @return the content length of the resource that this connection's URL
* references, or <code>-1</code> if the content length is
* not known.
* @since 7.0
*/
public long getContentLengthLong() {
return getHeaderFieldLong("content-length", -1);
}
代码示例来源:origin: jtulach/bck2brwsr
/**
* Returns the value of the <code>content-length</code> header field as a
* long.
*
* @return the content length of the resource that this connection's URL
* references, or <code>-1</code> if the content length is
* not known.
* @since 7.0
*/
public long getContentLengthLong() {
return getHeaderFieldLong("content-length", -1);
}
代码示例来源:origin: freeplane/freeplane
public long getHeaderFieldLong(String name, long Default) {
return connection.getHeaderFieldLong(name, Default);
}
代码示例来源:origin: com.jtransc/jtransc-rt
public long getContentLengthLong() {
return getHeaderFieldLong("Content-Length", -1);
}
代码示例来源:origin: octo-online/reactive-audit
@Test(expected = NetworkReactiveAuditException.class)
public void getHeaderFieldLong()
throws IOException
{
Assume.assumeTrue(IOTestTools.isNetworkConnected());
ReactiveAudit.off.commit();
URLConnection conn = new URL("http://" + HOST + ":" + PORT).openConnection();
TestTools.strict.commit();
conn.getHeaderFieldLong("expiration", 0);
}
内容来源于网络,如有侵权,请联系作者删除!