/** * 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); }
public void writeTag(byte tag) throws IOException { daos.writeByte(tag); }
public void writeTag(byte tag) throws IOException { daos.writeByte(tag); }
public void writeTag(byte tag) throws IOException { daos.writeByte(tag); }
protected void writeDouble(double val) throws IOException { daos.writeByte(DOUBLE); daos.writeDouble(val); }
public void writeFloat(float val) throws IOException { daos.writeByte(FLOAT); daos.writeFloat(val); }
public void writeFloat(float val) throws IOException { daos.writeByte(FLOAT); daos.writeFloat(val); }
protected void initWrite(OutputStream os) throws IOException { assert !alreadyMarshalled; init(FastOutputStream.wrap(os)); daos.writeByte(VERSION); }
public void marshal(NamedList nl, OutputStream os) throws IOException { daos = FastOutputStream.wrap(os); try { daos.writeByte(VERSION); writeNamedList(nl); } finally { daos.flushBuffer(); } }
public void marshal(Object nl, OutputStream os) throws IOException { init(FastOutputStream.wrap(os)); try { daos.writeByte(VERSION); writeVal(nl); } finally { daos.flushBuffer(); } }