Tabnine Logo
FastOutputStream.writeByte
Code IndexAdd Tabnine to your IDE (free)

How to use
writeByte
method
in
org.apache.solr.common.util.FastOutputStream

Best Java code snippets using org.apache.solr.common.util.FastOutputStream.writeByte (Showing top 20 results out of 315)

origin: org.apache.solr/solr-solrj

public static void writeVLong(long i, FastOutputStream out) throws IOException {
 while ((i & ~0x7F) != 0) {
  out.writeByte((byte) ((i & 0x7f) | 0x80));
  i >>>= 7;
 }
 out.writeByte((byte) i);
}
origin: org.apache.solr/solr-common

public static void writeVLong(long i, FastOutputStream out) throws IOException {
 while ((i & ~0x7F) != 0) {
  out.writeByte((byte)((i & 0x7f) | 0x80));
  i >>>= 7;
 }
 out.writeByte((byte) i);
}
origin: org.apache.solr/solr-solrj

/**
 * Special method for variable length int (copied from lucene). Usually used for writing the length of a
 * collection/array/map In most of the cases the length can be represented in one byte (length < 127) so it saves 3
 * bytes/object
 *
 * @throws IOException If there is a low-level I/O error.
 */
public static void writeVInt(int i, FastOutputStream out) throws IOException {
 while ((i & ~0x7F) != 0) {
  out.writeByte((byte) ((i & 0x7f) | 0x80));
  i >>>= 7;
 }
 out.writeByte((byte) i);
}
origin: org.apache.solr/solr-solrj

protected void writeBoolean(boolean val) throws IOException {
 if (val) daos.writeByte(BOOL_TRUE);
 else daos.writeByte(BOOL_FALSE);
}
origin: com.hynnet/solr-solrj

public static void writeVLong(long i, FastOutputStream out) throws IOException {
 while ((i & ~0x7F) != 0) {
  out.writeByte((byte) ((i & 0x7f) | 0x80));
  i >>>= 7;
 }
 out.writeByte((byte) i);
}
origin: com.hynnet/solr-solrj

public void writeTag(byte tag) throws IOException {
 daos.writeByte(tag);
}
origin: org.apache.solr/solr-solrj

public void writeTag(byte tag) throws IOException {
 daos.writeByte(tag);
}
origin: org.apache.solr/solr-common

public void writeTag(byte tag) throws IOException {
 daos.writeByte(tag);
}

origin: org.apache.solr/solr-solrj

public void writeLong(long val) throws IOException {
 if ((val & 0xff00000000000000L) == 0) {
  int b = SLONG | ((int) val & 0x0f);
  if (val >= 0x0f) {
   b |= 0x10;
   daos.writeByte(b);
   writeVLong(val >>> 4, daos);
  } else {
   daos.writeByte(b);
  }
 } else {
  daos.writeByte(LONG);
  daos.writeLong(val);
 }
}
origin: org.apache.solr/solr-solrj

public void writeTag(byte tag, int size) throws IOException {
 if ((tag & 0xe0) != 0) {
  if (size < 0x1f) {
   daos.writeByte(tag | size);
  } else {
   daos.writeByte(tag | 0x1f);
   writeVInt(size - 0x1f, daos);
  }
 } else {
  daos.writeByte(tag);
  writeVInt(size, daos);
 }
}
origin: org.apache.solr/solr-common

public void writeTag(byte tag, int size) throws IOException {
 if ((tag & 0xe0) != 0) {
  if (size < 0x1f) {
   daos.writeByte(tag | size);
  } else {
   daos.writeByte(tag | 0x1f);
   writeVInt(size-0x1f, daos);
  }
 } else {
  daos.writeByte(tag);
  writeVInt(size, daos);       
 }
}
origin: com.hynnet/solr-solrj

public void writeTag(byte tag, int size) throws IOException {
 if ((tag & 0xe0) != 0) {
  if (size < 0x1f) {
   daos.writeByte(tag | size);
  } else {
   daos.writeByte(tag | 0x1f);
   writeVInt(size - 0x1f, daos);
  }
 } else {
  daos.writeByte(tag);
  writeVInt(size, daos);
 }
}
origin: com.hynnet/solr-solrj

public void writeLong(long val) throws IOException {
 if ((val & 0xff00000000000000L) == 0) {
  int b = SLONG | ((int) val & 0x0f);
  if (val >= 0x0f) {
   b |= 0x10;
   daos.writeByte(b);
   writeVLong(val >>> 4, daos);
  } else {
   daos.writeByte(b);
  }
 } else {
  daos.writeByte(LONG);
  daos.writeLong(val);
 }
}
origin: org.apache.solr/solr-solrj

public void writeInt(int val) throws IOException {
 if (val > 0) {
  int b = SINT | (val & 0x0f);
  if (val >= 0x0f) {
   b |= 0x10;
   daos.writeByte(b);
   writeVInt(val >>> 4, daos);
  } else {
   daos.writeByte(b);
  }
 } else {
  daos.writeByte(INT);
  daos.writeInt(val);
 }
}
origin: org.apache.solr/solr-solrj

protected void writeDouble(double val) throws IOException {
 daos.writeByte(DOUBLE);
 daos.writeDouble(val);
}
origin: com.hynnet/solr-solrj

public void writeFloat(float val) throws IOException {
 daos.writeByte(FLOAT);
 daos.writeFloat(val);
}
origin: org.apache.solr/solr-solrj

public void writeFloat(float val) throws IOException {
 daos.writeByte(FLOAT);
 daos.writeFloat(val);
}
origin: org.apache.solr/solr-solrj

protected void initWrite(OutputStream os) throws IOException {
 assert !alreadyMarshalled;
 init(FastOutputStream.wrap(os));
 daos.writeByte(VERSION);
}
origin: org.apache.solr/solr-common

public void marshal(NamedList nl, OutputStream os) throws IOException {
 daos = FastOutputStream.wrap(os);
 try {
  daos.writeByte(VERSION);
  writeNamedList(nl);
 } finally {
  daos.flushBuffer();      
 }
}
origin: com.hynnet/solr-solrj

public void marshal(Object nl, OutputStream os) throws IOException {
 init(FastOutputStream.wrap(os));
 try {
  daos.writeByte(VERSION);
  writeVal(nl);
 } finally {
  daos.flushBuffer();
 }
}
org.apache.solr.common.utilFastOutputStreamwriteByte

Popular methods of FastOutputStream

  • flushBuffer
    Only flushes the buffer of the FastOutputStream, not that of the underlying stream.
  • wrap
  • <init>
  • write
  • writeInt
  • writeLong
  • flush
    All writes to the sink will go through this method
  • reserve
    reserve at least len bytes at the end of the buffer. Invalid if len > buffer.length
  • writeChar
  • writeDouble
  • writeFloat
  • writeShort
  • writeFloat,
  • writeShort,
  • close

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • String (java.lang)
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Best IntelliJ plugins
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