@Override public void convertAnyURI(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(returnTag); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
private void writeResult(IPointable resultPointable) throws IOException { dataOutput.writeByte(ATypeTag.SERIALIZED_STRING_TYPE_TAG); dataOutput.write(resultStrPtr.getByteArray(), 0, resultStrPtr.getLength()); resultPointable.set(resultStorage); } }
@Override public void convertString(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(returnTag); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public void convertNotation(UTF8StringPointable stringp, DataOutput dOut) throws SystemException, IOException { dOut.write(returnTag); dOut.write(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength()); }
@Override public char next() { // Default - no character exists. int c = ICharacterIterator.EOS_CHAR; if (byteOffset < stringp.getLength()) { c = stringp.charAt(byteOffset); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.finer(" UTF8StringCharacterIterator char[" + byteOffset + "] = " + c); } // Increment cursor if ((c >= 0x0001) && (c <= 0x007F)) { ++byteOffset; } else if (c > 0x07FF) { byteOffset += 3; } else { byteOffset += 2; } } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.finer(" END UTF8StringCharacterIterator char[" + byteOffset + "] = " + c); } return (char) c; }
@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()); }
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 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; } }
limit = Long.MIN_VALUE; int end = textPtr.getStartOffset() + textPtr.getLength(); for (; offset < end; offset++) { int digit;
@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); } } };
try { bbis.setByteBuffer(ByteBuffer.wrap(Arrays.copyOfRange(stringp.getByteArray(), stringp.getStartOffset(), stringp.getLength() + stringp.getStartOffset())), 0); collectionName = di.readUTF(); return collectionName;
/** * 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);
if (stringp.getLength() == 2) { XDMConstants.setEmptySequence(result); return;
tvp1.getValue(stringp1); out.write(ValueTag.XS_STRING_TAG); out.write(stringp1.getByteArray(), stringp1.getStartOffset(), stringp1.getLength()); result.set(abvs.getByteArray(), abvs.getStartOffset(), abvs.getLength()); } catch (IOException e) {