private int writeBooleanArray(boolean[] booleans, int len, byte[] bufLocal, int mask, int pos) { //writePackedInt(this,value); pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { bufLocal[mask & pos++] = (byte) (booleans[i] ? 1 : 0); } return pos; }
private int writeBooleanArray(boolean[] booleans, int len, byte[] bufLocal, int mask, int pos) { //writePackedInt(this,value); pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { bufLocal[mask & pos++] = (byte) (booleans[i] ? 1 : 0); } return pos; }
private int writeBooleanArray(boolean[] booleans, int len, byte[] bufLocal, int mask, int pos) { //writePackedInt(this,value); pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { bufLocal[mask & pos++] = (byte) (booleans[i] ? 1 : 0); } return pos; }
private static <T extends MessageSchema<T>> int writeByteArray(DataOutputBlobWriter<T> writer, byte[] bytes, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); Pipe.copyBytesFromArrayToRing(bytes, 0, writer.byteBuffer, pos, writer.byteMask, len); return pos+len; }
private int writeUTFArray(String[] utfs, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = writeUTF(this, utfs[i], utfs[i].length(), mask, bufLocal, pos); } return pos; }
private static <T extends MessageSchema<T>> int writeByteArray(DataOutputBlobWriter<T> writer, byte[] bytes, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); Pipe.copyBytesFromArrayToRing(bytes, 0, writer.byteBuffer, pos, writer.byteMask, len); return pos+len; }
private int writeCharArray(char[] chars, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write16(bufLocal, mask, pos, (int) chars[i]); } return pos; }
private int writeDoubleArray(double[] doubles, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write64(bufLocal, mask, pos, Double.doubleToLongBits(doubles[i])); } return pos; }
private int writeLongArray(long[] longs, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write64(bufLocal, mask, pos, longs[i]); } return pos; }
private int writeFloatArray(float[] floats, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write32(bufLocal, mask, pos, Float.floatToIntBits(floats[i])); } return pos; }
private int writeUTFArray(String[] utfs, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = writeUTF(this, utfs[i], utfs[i].length(), mask, bufLocal, pos); } return pos; }
private int writeLongArray(long[] longs, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write64(bufLocal, mask, pos, longs[i]); } return pos; }
private int writeShortArray(short[] shorts, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write16(bufLocal, mask, pos, shorts[i]); } return pos; }
private int writeDoubleArray(double[] doubles, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write64(bufLocal, mask, pos, Double.doubleToLongBits(doubles[i])); } return pos; }
private int writeShortArray(short[] shorts, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write16(bufLocal, mask, pos, shorts[i]); } return pos; }
private int writeIntArray(int[] ints, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write32(bufLocal, mask, pos, ints[i]); } return pos; }
private int writeDoubleArray(double[] doubles, int len, byte[] bufLocal, int mask, int pos) { pos = writePackedInt(bufLocal, mask, pos, len); for(int i=0;i<len;i++) { pos = write64(bufLocal, mask, pos, Double.doubleToLongBits(doubles[i])); } return pos; }
/** * Writes int to specified field in pipe * calls selectStruct(id) only after setting all the object fields * @param assoc field association showing where to write * @param value int to be written */ public void writeInt(Object assoc, int value) { assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; storeAssocAndPosition(assoc); channelWriter.writePackedInt(value); }
/** * Writes short to specified field in pipe * calls selectStruct(id) only after setting all the object fields * @param assoc field association showing where to write * @param value short to be written */ public void writeShort(Object assoc, short value) { assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; storeAssocAndPosition(assoc); channelWriter.writePackedInt(value); }
/** * Writes int to specified field in pipe * calls selectStruct(id) only after setting all the object fields * @param assoc field association showing where to write * @param value int to be written */ public void writeInt(Object assoc, int value) { assert(DataOutputBlobWriter.getStructType(channelWriter)<=0) : "call selectStruct(id) only after setting all the object fields."; storeAssocAndPosition(assoc); channelWriter.writePackedInt(value); }