List of usage examples for org.apache.solr.common.util ContentStream getSourceInfo
String getSourceInfo();
From source file:org.vootoo.client.netty.util.ProtobufUtil.java
License:Apache License
public static List<SolrProtocol.ContentStream> toProtobufContentStreams( Collection<ContentStream> contentStreams) { return Lists.transform(Lists.newArrayList(contentStreams), new Function<ContentStream, SolrProtocol.ContentStream>() { @Override/*w w w. jav a 2 s . c om*/ public SolrProtocol.ContentStream apply(ContentStream input) { SolrProtocol.ContentStream.Builder stream = SolrProtocol.ContentStream.newBuilder(); if (input.getName() != null) { stream.setName(input.getName()); } String contentType = input.getContentType(); if (contentType == null) { // default javabin contentType = BinaryResponseParser.BINARY_CONTENT_TYPE; } stream.setContentType(contentType); stream.setSourceInfo(input.getSourceInfo()); stream.setSize(input.getSize()); try { //TODO zero copy byte stream.setStream(ByteString.readFrom(input.getStream())); } catch (IOException e) { //TODO dealing input.getStream() exception throw new RuntimeException("ContentStream.getStream() exception", e); } return stream.build(); } }); }