public int getCharStartOffset() { return getStartOffset() + getMetaDataLength(); }
@Override public void convertAnyURI(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(returnTag); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public void convertString(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(returnTag); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
/**** * String functions */ public int ignoreCaseCompareTo(UTF8StringPointable other) { return UTF8StringUtil.lowerCaseCompareTo(this.getByteArray(), this.getStartOffset(), other.getByteArray(), other.getStartOffset()); }
@Override public void convertNotation(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(returnTag); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
public static String getStringFromPointable(UTF8StringPointable stringp, ByteBufferInputStream bbis, DataInputStream di) throws SystemException { try { bbis.setByteBuffer(ByteBuffer.wrap(Arrays.copyOfRange(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength() + stringp.getStartOffset())), 0); return di.readUTF(); } catch (IOException e) { throw new SystemException(ErrorCode.SYSE0001, e); } }
@Override public void convertNotation(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_NOTATION_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public void convertString(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_NOTATION_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public void convertAnyURI(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_ANY_URI_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public void convertString(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(ValueTag.XS_ANY_URI_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public void convertString(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { baaos.reset(); Base64OutputStream b64os = new Base64OutputStream(baaos, false); b64os.write(stringp.getByteArray(), stringp.getStartOffset() + 2, stringp.getLength() - 2); b64os.close(); dOut.write(ValueTag.XS_BASE64_BINARY_TAG); dOut.write((byte) ((baaos.size() >>> 8) & 0xFF)); dOut.write((byte) ((baaos.size() >>> 0) & 0xFF)); dOut.write(baaos.getByteArray(), 0, baaos.size()); }
public int lookup(UTF8StringPointable str) { boolean found = binSearch.find(sortedStringsVector, str); int index = binSearch.getIndex(); if (found) { return sortedSlotIndexes.getArray()[index]; } dataBuffer.write(str.getByteArray(), str.getStartOffset(), str.getLength()); int slotIndex = stringEndOffsets.getSize(); try { dataBufferOut.writeInt(slotIndex); } catch (IOException e) { throw new IllegalStateException(e); } stringEndOffsets.append(dataBuffer.size()); sortedSlotIndexes.insert(index, slotIndex); cacheReady = false; return slotIndex; } }
public static UTF8StringPointable copyResetUTF8Pointable(UTF8StringPointable srcString, ByteArrayAccessibleOutputStream destCopyStorage, UTF8StringPointable destString) { destCopyStorage.reset(); destCopyStorage.write(srcString.getByteArray(), srcString.getStartOffset(), srcString.getMetaDataLength() + srcString.getUTF8Length()); destString.set(destCopyStorage.getByteArray(), 0, destCopyStorage.size()); return destString; }
offset = oldFieldNamePointable.getStartOffset(); typeTag = data[offset]; if (typeTag != ATypeTag.SERIALIZED_STRING_TYPE_TAG) { offset = newFieldNamePointable.getStartOffset(); typeTag = data[offset]; if (typeTag != ATypeTag.SERIALIZED_STRING_TYPE_TAG) {
@Override protected void evaluate(TaggedValuePointable[] args, IPointable result) throws SystemException { TaggedValuePointable tvp1 = args[0]; // Only accept a QNames or empty sequence. if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) { tvp1.getValue(seqp); if (seqp.getEntryCount() == 0) { XDMConstants.setEmptySequence(result); return; } // Pass through. } if (tvp1.getTag() != ValueTag.XS_QNAME_TAG) { throw new SystemException(ErrorCode.FORG0006); } tvp1.getValue(qnamep); qnamep.getLocalName(stringp); try { abvs.reset(); dOut.write(ValueTag.XS_NCNAME_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); result.set(abvs); } catch (Exception e) { throw new SystemException(ErrorCode.SYSE0001, e); } } };
/** * Generates a reversed string from an input source string * * @param srcPtr * , the input source string. * @param builder * , a builder for the resulting string. * @param out * , the storage for a result string. * @throws IOException */ public static void reverse(UTF8StringPointable srcPtr, UTF8StringBuilder builder, GrowableArray out) throws IOException { builder.reset(out, srcPtr.getUTF8Length()); int srcStart = srcPtr.getCharStartOffset(); int srcEnd = srcPtr.getStartOffset() + srcPtr.getLength() - 1; for (int cursorIndex = srcEnd; cursorIndex >= srcStart; cursorIndex--) { if (UTF8StringUtil.isCharStart(srcPtr.bytes, cursorIndex)) { int charSize = UTF8StringUtil.charSize(srcPtr.bytes, cursorIndex); builder.appendUtf8StringPointable(srcPtr, cursorIndex, charSize); } } builder.finish(); }
abvs.reset(); dOut.write(ValueTag.XS_NCNAME_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); result.set(abvs);
abvs.reset(); dOut.write(ValueTag.XS_NCNAME_TAG); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); result.set(abvs);
@Override public void evaluate(IFrameTupleReference tuple, IPointable result) throws HyracksDataException { resultStorage.reset(); boolean returnNull = false; eval0.evaluate(tuple, inputRecordPointable); byte[] data = inputRecordPointable.getByteArray(); int offset = inputRecordPointable.getStartOffset(); byte typeTag = data[offset]; if (typeTag != ATypeTag.SERIALIZED_RECORD_TYPE_TAG) { returnNull = true; } eval1.evaluate(tuple, fieldToRemovePointable); data = fieldToRemovePointable.getByteArray(); offset = fieldToRemovePointable.getStartOffset(); typeTag = data[offset]; if (typeTag != ATypeTag.SERIALIZED_STRING_TYPE_TAG) { returnNull = true; } if (returnNull) { PointableHelper.setNull(result); return; } evaluate(); result.set(resultStorage); }
int leftStartOffset1 = leftStrPointable1.getStartOffset(); byte[] rightBytes1 = rightStrPointable1.getByteArray(); int rightStartOffset1 = rightStrPointable1.getStartOffset(); byte[] rightBytes2 = rightStrPointable2.getByteArray(); int rightStartOffset2 = rightStrPointable2.getStartOffset();