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

    jcr:content and datastream in modeshape 2.x

    Ivan Vasyliev Newbie



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



          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);





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