Tabnine Logo
JavaBinCodec.readSize
Code IndexAdd Tabnine to your IDE (free)

How to use
readSize
method
in
org.apache.solr.common.util.JavaBinCodec

Best Java code snippets using org.apache.solr.common.util.JavaBinCodec.readSize (Showing top 12 results out of 315)

origin: org.apache.solr/solr-solrj

public List<Object> readArray(DataInputInputStream dis) throws IOException {
 int sz = readSize(dis);
 ArrayList<Object> l = new ArrayList<>(sz);
 for (int i = 0; i < sz; i++) {
  l.add(readVal(dis));
 }
 return l;
}
origin: com.hynnet/solr-solrj

public List<Object> readArray(DataInputInputStream dis) throws IOException {
 int sz = readSize(dis);
 ArrayList<Object> l = new ArrayList<>(sz);
 for (int i = 0; i < sz; i++) {
  l.add(readVal(dis));
 }
 return l;
}
origin: org.apache.solr/solr-solrj

public String readExternString(DataInputInputStream fis) throws IOException {
 int idx = readSize(fis);
 if (idx != 0) {// idx != 0 is the index of the extern string
  return stringsList.get(idx - 1);
 } else {// idx == 0 means it has a string value
  tagByte = fis.readByte();
  String s = readStr(fis, stringCache);
  if (stringsList == null) stringsList = new ArrayList<>();
  stringsList.add(s);
  return s;
 }
}
origin: com.hynnet/solr-solrj

public String readExternString(DataInputInputStream fis) throws IOException {
 int idx = readSize(fis);
 if (idx != 0) {// idx != 0 is the index of the extern string
  return stringsList.get(idx - 1);
 } else {// idx == 0 means it has a string value
  tagByte = fis.readByte();
  String s = readStr(fis, stringCache);
  if (stringsList == null) stringsList = new ArrayList<>();
  stringsList.add(s);
  return s;
 }
}
origin: org.apache.solr/solr-solrj

public SimpleOrderedMap<Object> readOrderedMap(DataInputInputStream dis) throws IOException {
 int sz = readSize(dis);
 SimpleOrderedMap<Object> nl = new SimpleOrderedMap<>(sz);
 for (int i = 0; i < sz; i++) {
  String name = (String) readVal(dis);
  Object val = readVal(dis);
  nl.add(name, val);
 }
 return nl;
}
origin: org.apache.solr/solr-solrj

public NamedList<Object> readNamedList(DataInputInputStream dis) throws IOException {
 int sz = readSize(dis);
 NamedList<Object> nl = new NamedList<>(sz);
 for (int i = 0; i < sz; i++) {
  String name = (String) readVal(dis);
  Object val = readVal(dis);
  nl.add(name, val);
 }
 return nl;
}
origin: com.hynnet/solr-solrj

public SimpleOrderedMap<Object> readOrderedMap(DataInputInputStream dis) throws IOException {
 int sz = readSize(dis);
 SimpleOrderedMap<Object> nl = new SimpleOrderedMap<>();
 for (int i = 0; i < sz; i++) {
  String name = (String) readVal(dis);
  Object val = readVal(dis);
  nl.add(name, val);
 }
 return nl;
}
origin: com.hynnet/solr-solrj

public NamedList<Object> readNamedList(DataInputInputStream dis) throws IOException {
 int sz = readSize(dis);
 NamedList<Object> nl = new NamedList<>();
 for (int i = 0; i < sz; i++) {
  String name = (String) readVal(dis);
  Object val = readVal(dis);
  nl.add(name, val);
 }
 return nl;
}
origin: org.apache.solr/solr-solrj

public SolrDocument readSolrDocument(DataInputInputStream dis) throws IOException {
 tagByte = dis.readByte();
 int size = readSize(dis);
 SolrDocument doc = new SolrDocument(new LinkedHashMap<>(size));
 for (int i = 0; i < size; i++) {
  String fieldName;
  Object obj = readVal(dis); // could be a field name, or a child document
  if (obj instanceof SolrDocument) {
   doc.addChildDocument((SolrDocument)obj);
   continue;
  } else {
   fieldName = (String)obj;
  }
  Object fieldVal = readVal(dis);
  doc.setField(fieldName, fieldVal);
 }
 return doc;
}
origin: org.apache.solr/solr-solrj

public String readStr(DataInputInputStream dis, StringCache stringCache) throws IOException {
 int sz = readSize(dis);
 if (bytes == null || bytes.length < sz) bytes = new byte[sz];
 dis.readFully(bytes, 0, sz);
 if (stringCache != null) {
  return stringCache.get(bytesRef.reset(bytes, 0, sz));
 } else {
  arr.reset();
  ByteUtils.UTF8toUTF16(bytes, 0, sz, arr);
  return arr.toString();
 }
}
origin: com.hynnet/solr-solrj

public String readStr(DataInputInputStream dis, StringCache stringCache) throws IOException {
 int sz = readSize(dis);
 if (bytes == null || bytes.length < sz) bytes = new byte[sz];
 dis.readFully(bytes, 0, sz);
 if (stringCache != null) {
  return stringCache.get(bytesRef.reset(bytes, 0, sz));
 } else {
  arr.reset();
  ByteUtils.UTF8toUTF16(bytes, 0, sz, arr);
  return arr.toString();
 }
}
origin: com.hynnet/solr-solrj

public SolrDocument readSolrDocument(DataInputInputStream dis) throws IOException {
 tagByte = dis.readByte();
 int size = readSize(dis);
 SolrDocument doc = new SolrDocument();
 for (int i = 0; i < size; i++) {
  String fieldName;
  Object obj = readVal(dis); // could be a field name, or a child document
  if (obj instanceof SolrDocument) {
   doc.addChildDocument((SolrDocument)obj);
   continue;
  } else {
   fieldName = (String)obj;
  }
  Object fieldVal = readVal(dis);
  doc.setField(fieldName, fieldVal);
 }
 return doc;
}
org.apache.solr.common.utilJavaBinCodecreadSize

Popular methods of JavaBinCodec

  • <init>
  • marshal
  • unmarshal
  • init
    expert: sets a new output stream
  • readVal
  • writeVal
  • readIterator
  • writeArray
  • writeMap
  • writeSolrDocument
  • writeTag
  • readArray
  • writeTag,
  • readArray,
  • readByteArray,
  • readEnumFieldValue,
  • readExternString,
  • readMap,
  • readMapEntry,
  • readNamedList,
  • readOrderedMap

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JLabel (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now