/** * Writes position and length of byte to add to the pipe * @param pipe pipe to be written to * @param position position of byte * @param length length of byte * @param <S> MessageSchema to be extended */ public static <S extends MessageSchema<S>> void addBytePosAndLen(Pipe<S> pipe, int position, int length) { addBytePosAndLenSpecial(pipe,position,length); }
/** * Writes position and length of byte to add to the pipe * @param pipe pipe to be written to * @param position position of byte * @param length length of byte * @param <S> MessageSchema to be extended */ public static <S extends MessageSchema<S>> void addBytePosAndLen(Pipe<S> pipe, int position, int length) { addBytePosAndLenSpecial(pipe,position,length); }
/** * Writes position and length of byte to add to the pipe * @param pipe pipe to be written to * @param position position of byte * @param length length of byte * @param <S> MessageSchema to be extended */ public static <S extends MessageSchema<S>> void addBytePosAndLen(Pipe<S> pipe, int position, int length) { addBytePosAndLenSpecial(pipe,position,length); }
public int closeLowLevelField() { int len = length(); Pipe.addAndGetBlobWorkingHeadPosition(p, len); Pipe.addBytePosAndLenSpecial(p,startPosition,len); p.closeBlobFieldWrite(); return len; }
public int closeLowLevelField() { int len = length(); Pipe.addAndGetBlobWorkingHeadPosition(p, len); Pipe.addBytePosAndLenSpecial(p,startPosition,len); p.closeBlobFieldWrite(); return len; }
public int closeLowLevelField() { int len = length(); Pipe.addAndGetBlobWorkingHeadPosition(p, len); Pipe.addBytePosAndLenSpecial(p,startPosition,len); p.closeBlobFieldWrite(); return len; }
/** * Add byte array to target pipe * * @param outputRing Pipe target * @param mask int mask to loop arround data target * @param len int total bytes to copy * @param data byte[] backing array * @param offset int bytes position */ public static <S extends MessageSchema<S>> void addByteArrayWithMask(final Pipe<S> outputRing, int mask, int len, byte[] data, int offset) { validateVarLength(outputRing, len); copyBytesFromToRing(data,offset,mask,outputRing.blobRing,PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos),outputRing.blobMask, len); addBytePosAndLenSpecial(outputRing, PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos),len); PaddedInt.set(outputRing.blobRingHead.byteWorkingHeadPos, BYTES_WRAP_MASK&(PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos) + len)); }
/** * Add byte array to target pipe * * @param outputRing Pipe target * @param mask int mask to loop arround data target * @param len int total bytes to copy * @param data byte[] backing array * @param offset int bytes position */ public static <S extends MessageSchema<S>> void addByteArrayWithMask(final Pipe<S> outputRing, int mask, int len, byte[] data, int offset) { validateVarLength(outputRing, len); copyBytesFromToRing(data,offset,mask,outputRing.blobRing,PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos),outputRing.blobMask, len); addBytePosAndLenSpecial(outputRing, PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos),len); PaddedInt.set(outputRing.blobRingHead.byteWorkingHeadPos, BYTES_WRAP_MASK&(PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos) + len)); }
/** * Add byte array to target pipe * * @param outputRing Pipe target * @param mask int mask to loop arround data target * @param len int total bytes to copy * @param data byte[] backing array * @param offset int bytes position */ public static <S extends MessageSchema<S>> void addByteArrayWithMask(final Pipe<S> outputRing, int mask, int len, byte[] data, int offset) { validateVarLength(outputRing, len); copyBytesFromToRing(data,offset,mask,outputRing.blobRing,PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos),outputRing.blobMask, len); addBytePosAndLenSpecial(outputRing, PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos),len); PaddedInt.set(outputRing.blobRingHead.byteWorkingHeadPos, BYTES_WRAP_MASK&(PaddedInt.get(outputRing.blobRingHead.byteWorkingHeadPos) + len)); }
public static <T extends MessageSchema<T>> int closeLowLeveLField(DataOutputBlobWriter<T> writer, int len) { if (writer.structuredWithIndexData) { //write this field as length len but move head to the end of maxvarlen writer.activePosition = writer.lastPosition; Pipe.setBlobWorkingHead(writer.backingPipe, writer.activePosition & Pipe.BYTES_WRAP_MASK); } else { //do not keep index just move forward by length size Pipe.addAndGetBlobWorkingHeadPosition(writer.backingPipe, len); } assert(writer.startPosition>=0) : "Error bad position of "+writer.startPosition+" length was "+len; Pipe.addBytePosAndLenSpecial(writer.backingPipe, writer.startPosition, len); Pipe.validateVarLength(writer.backingPipe, len); writer.backingPipe.closeBlobFieldWrite(); if (writer.structuredWithIndexData) { //set the flag marking this as structed. Pipe.slab(writer.backingPipe)[writer.backingPipe.slabMask & (int)(Pipe.workingHeadPosition(writer.backingPipe)-2)] |= Pipe.STRUCTURED_POS_MASK; } return len; }
public static <T extends MessageSchema<T>> int closeLowLeveLField(DataOutputBlobWriter<T> writer, int len) { assert(len<=writer.backingPipe.sizeOfBlobRing): "bad length "+len+" larger than pipe"; if (writer.structuredWithIndexData) { //write this field as length len but move head to the end of maxvarlen writer.activePosition = writer.lastPosition; Pipe.setBlobWorkingHead(writer.backingPipe, writer.activePosition & Pipe.BYTES_WRAP_MASK); } else { //do not keep index just move forward by length size Pipe.addAndGetBlobWorkingHeadPosition(writer.backingPipe, len); } assert(writer.startPosition>=0) : "Error bad position of "+writer.startPosition+" length was "+len; Pipe.addBytePosAndLenSpecial(writer.backingPipe, writer.startPosition, len); Pipe.validateVarLength(writer.backingPipe, len); writer.backingPipe.closeBlobFieldWrite(); if (writer.structuredWithIndexData) { //set the flag marking this as structed. Pipe.slab(writer.backingPipe)[writer.backingPipe.slabMask & (int)(Pipe.workingHeadPosition(writer.backingPipe)-2)] |= Pipe.STRUCTURED_POS_MASK; } return len; }
public static <T extends MessageSchema<T>> int closeLowLeveLField(DataOutputBlobWriter<T> writer, int len) { assert(len<=writer.backingPipe.sizeOfBlobRing): "bad length "+len+" larger than pipe"; if (writer.structuredWithIndexData) { //write this field as length len but move head to the end of maxvarlen writer.activePosition = writer.lastPosition; Pipe.setBlobWorkingHead(writer.backingPipe, writer.activePosition & Pipe.BYTES_WRAP_MASK); } else { //do not keep index just move forward by length size Pipe.addAndGetBlobWorkingHeadPosition(writer.backingPipe, len); } assert(writer.startPosition>=0) : "Error bad position of "+writer.startPosition+" length was "+len; Pipe.addBytePosAndLenSpecial(writer.backingPipe, writer.startPosition, len); Pipe.validateVarLength(writer.backingPipe, len); writer.backingPipe.closeBlobFieldWrite(); if (writer.structuredWithIndexData) { //set the flag marking this as structed. Pipe.slab(writer.backingPipe)[writer.backingPipe.slabMask & (int)(Pipe.workingHeadPosition(writer.backingPipe)-2)] |= Pipe.STRUCTURED_POS_MASK; } return len; }
Pipe.addBytePosAndLenSpecial(outLog, startPos, blockLen); startPos += blockLen; writeLength -= blockLen;
Pipe.addBytePosAndLenSpecial(output, startPos, blockLen);