code: public InputStream getInputStream() throws IOException, RepositoryException
     {
        final PipedInputStream pin = new PipedInputStream();
        final PipedOutputStream pout = new PipedOutputStream(pin);
  
        try
        {
  
           new Thread()
           {
  
              /*
               * (non-Javadoc)
               * 
               * @see java.lang.Thread#run()
               */
              public void run()
              {
                 try
                 {
                    if (isSystem)
                    {
                       node.getSession().exportSystemView(node.getPath(), pout, false, false);
                    }
                    else
                    {
                       node.getSession().exportDocumentView(node.getPath(), pout, false, false);
                    }
                 }
                 catch (Exception e)
                 {
                    if (LOG.isTraceEnabled())
                    {
                       LOG.trace("An exception occurred: " + e.getMessage());
                    }
                 }
                 finally
                 {
                    try
                    {
                       pout.flush();
                       pout.close();
                    }
                    catch (Exception e)
                    {
                       if (LOG.isTraceEnabled())
                       {
                          LOG.trace("An exception occurred: " + e.getMessage());
                       }
                    }
                 }
              }
  
           }.start();
  
           return pin;
        }
        catch (Exception e)
        {
           LOG.error(e.getLocalizedMessage(), e);
           throw new IOException("can't get input stream", e);
        }
  
     }
docs: /* (non-Javadoc)
  @see org.exoplatform.services.jcr.ext.resource.NodeRepresentation#getInputStream()