org.apache.stanbol.enhancer.servicesapi.Blob.getContentLength()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.apache.stanbol.enhancer.servicesapi.Blob.getContentLength()方法的一些代码示例,展示了Blob.getContentLength()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Blob.getContentLength()方法的具体详情如下:
包路径:org.apache.stanbol.enhancer.servicesapi.Blob
类名称:Blob
方法名:getContentLength

Blob.getContentLength介绍

[英]The size of the Content in bytes or a negative value if not known
[中]内容的大小(以字节为单位),如果未知,则为负值

代码示例

代码示例来源:origin: apache/stanbol

@Override
public long getContentLength() {
  if(_blob == null){ //do not dereference for calls on getContentLength
    return -1;
  } else {
    return _blob.getContentLength();
  }
}
public Blob getLazy() {

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.enhancer.servicesapi

@Override
public long getContentLength() {
  if(_blob == null){ //do not dereference for calls on getContentLength
    return -1;
  } else {
    return _blob.getContentLength();
  }
}
public Blob getLazy() {

代码示例来源:origin: apache/stanbol

@Override
public String toString() {
  return String.format("%s uri=[%s], content=[%s;mime-type:%s%s], metadata=[%s triples], " +
      "parts=%s", 
    getClass().getSimpleName(), //the implementation
    getUri().getUnicodeString(), //the URI
    //the size in Bytes (if available)
    getBlob().getContentLength()>=0 ?("size:"+getBlob().getContentLength()+" bytes;") : "",
    getBlob().getMimeType(), //the mime-type
    //and parameter (if available)
    getBlob().getParameter().isEmpty() ? "" : (";parameter:"+getBlob().getParameter()),
    getMetadata().size(), //the number of triples
    parts.keySet()); //and the part URIs
}

代码示例来源:origin: org.apache.stanbol/org.apache.stanbol.enhancer.servicesapi

@Override
public String toString() {
  return String.format("%s uri=[%s], content=[%s;mime-type:%s%s], metadata=[%s triples], " +
      "parts=%s", 
    getClass().getSimpleName(), //the implementation
    getUri().getUnicodeString(), //the URI
    //the size in Bytes (if available)
    getBlob().getContentLength()>=0 ?("size:"+getBlob().getContentLength()+" bytes;") : "",
    getBlob().getMimeType(), //the mime-type
    //and parameter (if available)
    getBlob().getParameter().isEmpty() ? "" : (";parameter:"+getBlob().getParameter()),
    getMetadata().size(), //the number of triples
    parts.keySet()); //and the part URIs
}

代码示例来源:origin: apache/stanbol

blob.getStream(), blob.getContentLength(),
ContentType.create(blob.getMimeType(), 
  blob.getParameter().get("charset"))));

代码示例来源:origin: apache/stanbol

request.addHeader(HttpHeaders.CONTENT_LANGUAGE, language);
request.setEntity(new InputStreamEntity(
  blob.getStream(), blob.getContentLength(),
  ContentType.create(blob.getMimeType(), 
    blob.getParameter().get("charset"))));

相关文章