private void writePosition(int pos) throws IOException { assert (pos >= 0); if (pos >= 0) { output.writeVInt(pos); } }
private void writePotentiallyNegativeVInt(int value) throws IOException { // term freq etc. can be negative if not present... we transport that // further... output.writeVInt(Math.max(0, value + 1)); }
private void startTerm(BytesRef term) throws IOException { output.writeVInt(term.length); output.writeBytes(term.bytes, term.offset, term.length); }
private BytesReference writeHeader(int numFieldsWritten, boolean getTermStatistics, boolean getFieldStatistics, boolean scores) throws IOException { // now, write the information about offset of the terms in the // termVectors field BytesStreamOutput header = new BytesStreamOutput(); header.writeString(HEADER); header.writeInt(CURRENT_VERSION); header.writeBoolean(getTermStatistics); header.writeBoolean(getFieldStatistics); header.writeBoolean(scores); header.writeVInt(numFieldsWritten); for (int i = 0; i < fields.size(); i++) { header.writeString(fields.get(i)); header.writeVLong(fieldOffset.get(i).longValue()); } header.close(); return header.bytes(); }
private void writePosition(int pos) throws IOException { assert (pos >= 0); if (pos >= 0) { output.writeVInt(pos); } }
private void writePosition(int pos) throws IOException { assert (pos >= 0); if (pos >= 0) { output.writeVInt(pos); } }
private void writePotentiallyNegativeVInt(int value) throws IOException { // term freq etc. can be negative if not present... we transport that // further... output.writeVInt(Math.max(0, value + 1)); }
private void writePotentiallyNegativeVInt(int value) throws IOException { // term freq etc. can be negative if not present... we transport that // further... output.writeVInt(Math.max(0, value + 1)); }
private void writePotentiallyNegativeVInt(int value) throws IOException { // term freq etc. can be negative if not present... we transport that // further... output.writeVInt(Math.max(0, value + 1)); }
private void startTerm(BytesRef term) throws IOException { output.writeVInt(term.length); output.writeBytes(term.bytes, term.offset, term.length); }