Package org.exoplatform.services.jcr.core.value

Examples of org.exoplatform.services.jcr.core.value.ReadableBinaryValue


      String pname = "file@" + testFile.getName();
      Property p = testRoot.setProperty(pname, new FileInputStream(testFile));
      testRoot.save();

      // read partial
      ReadableBinaryValue exv = (ReadableBinaryValue)testRoot.getProperty(pname).getValue();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();

      int len = 200 * 1024;
      int pos = 900 * 1024;
      long res = exv.read(baos, len, pos);

      assertEquals("Wrong bytes count have been read", len, res);

      compareStream(new FileInputStream(testFile), new ByteArrayInputStream(baos.toByteArray()), pos, 0, len);
   }
View Full Code Here


      String pname = "file@" + testFile.getName();
      Property p = testRoot.setProperty(pname, new FileInputStream(testFile));
      testRoot.save();

      // read partial
      ReadableBinaryValue exv = (ReadableBinaryValue)testRoot.getProperty(pname).getValue();

      ByteArrayOutputStream baos = new ByteArrayOutputStream();

      int len = 200 * 1024;
      int pos = 900 * 1024;
      long res = exv.read(baos, len, pos);

      assertEquals("Wrong bytes count have been read", len, res);

      compareStream(new FileInputStream(testFile), new ByteArrayInputStream(baos.toByteArray()), pos, 0, len);
   }
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.core.value.ReadableBinaryValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.