2 Replies Latest reply on Jan 9, 2013 2:31 PM by vasilievip

    jcr:content and datastream in modeshape 2.x

    vasilievip

      [AbstractBinaryValueFactory|https://github.com/ModeShape/modeshape/blob/2.8.x/modeshape-graph/src/main/java/org/modeshape/graph/property/basic/AbstractBinaryValueFactory.java]

       

      The conversion of contrent data stream to binary property will try to push the stream into memory:

       

      {code}

          public Binary create( InputStream stream,

                                long approximateLength ) throws IoException {

              if (stream == null) return null;

              try {

                  byte[] value = IoUtil.readBytes(stream);

                  return create(value);

              } catch (IOException err) {

                  throw new IoException(GraphI18n.errorConvertingIo.text(InputStream.class.getSimpleName(),

                                                                         Binary.class.getSimpleName()), err);

              }

          };

      {code}

       

      I assume this is not good. Should this be fixed or I'm missing something?