class JcrValue implements javax.jcr.Value {

    long getLength() throws RepositoryException {
        if (value == null) return 0L;
        if (type == PropertyType.BINARY) {
            return factories().getBinaryFactory().create(value).getSize();
        }
        return getString().length();
    }

      JcrValue( ValueFactories factories,
              int type,
              Object value );
      JcrValue( ValueFactories factories,
              Value value );

}