Examples of RandomInputStream


Examples of com.antlersoft.util.RandomInputStream

        allocatorLock = new ReentrantLock();
        chunkSize=allocator.getChunkSize();
        customizer=c;
        randomOutput=new RandomOutputStream();
        objectOutput=customizer.createObjectOutputStream( randomOutput);
        randomInput=new RandomInputStream();
        // Get past header portion of object stream
        objectOutput.writeObject( new Integer( 1));
        randomInput.emptyAddBytes( randomOutput.getWrittenBytes());
        objectInput=customizer.createObjectInputStream( randomInput);
        objectInput.readObject();
View Full Code Here

Examples of com.antlersoft.util.RandomInputStream

      dataOutputStream=new StreamPair( new DataOutputStream( dataStream),
                dataStream);
      RandomOutputStream outStream=new RandomOutputStream();
      outputStreams=new StreamPair(
                customizer.createObjectOutputStream( outStream), outStream);
      RandomInputStream inStream=new RandomInputStream();
      inStream.emptyAddBytes( outputStreams.writeObject( new Integer( 1)));
      inputStreams=new StreamPair(
                customizer.createObjectInputStream( inStream), inStream);

      // Initialize streams with stream header data
      ((ObjectInputStream)inputStreams.objectStream).readObject();
View Full Code Here

Examples of com.impossibl.postgres.jdbc.util.RandomInputStream

  @Test
  public void testUpload() throws Exception {

    conn.setAutoCommit(false);

    InputStream largeInputStream = ByteStreams.limit(new RandomInputStream(), 450 * 1024 * 1024);

    Blob blob = conn.createBlob();
    OutputStream blobOut = blob.setBinaryStream(1);

    long start = System.currentTimeMillis();
View Full Code Here

Examples of org.apache.chemistry.opencmis.workbench.RandomInputStream

                versioningState, null, null, null);
    }

    public ContentStream createContentStream(String name, long length, long seed) throws Exception {
        return clientSession.getSession().getObjectFactory()
                .createContentStream(name, length, "application/octet-stream", new RandomInputStream(length, seed));
    }
View Full Code Here

Examples of org.apache.chemistry.opencmis.workbench.RandomInputStream

        }
    }

    public ContentStream createContentStream(String name, long length, long seed) throws Exception {
        return clientSession.getSession().getObjectFactory()
                .createContentStream(name, length, "application/octet-stream", new RandomInputStream(length, seed));
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.data.RandomInputStream

    }

    @Test
    public void testReferenceBinary() throws RepositoryException {
        ValueFactory valueFactory = getAdminSession().getValueFactory();
        Binary binary = valueFactory.createBinary(new RandomInputStream(1, 256*1024));

        String reference = binary instanceof ReferenceBinary
            ? ((ReferenceBinary) binary).getReference()
            : null;

View Full Code Here

Examples of org.apache.jackrabbit.core.data.RandomInputStream

    }

    @Test
    public void testReferenceBinary() throws RepositoryException {
        ValueFactory valueFactory = getAdminSession().getValueFactory();
        Binary binary = valueFactory.createBinary(new RandomInputStream(1, 256 * 1024));

        String reference = binary instanceof ReferenceBinary
            ? ((ReferenceBinary) binary).getReference()
            : null;

View Full Code Here

Examples of org.apache.jackrabbit.core.data.RandomInputStream

    public void testReferenceBinaryExchangeWithSharedRepository() throws Exception {

        Session firstSession = superuser;

        // create a binary
        Binary b = vf.createBinary(new RandomInputStream(1, STREAM_LENGTH));

        ReferenceBinary referenceBinary = null;
        if (b instanceof ReferenceBinary) {
            referenceBinary = (ReferenceBinary) b;
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.data.RandomInputStream

        LOG.info(Thread.currentThread().getName() + " started.");
        ArrayList<DataRecord> list = new ArrayList<DataRecord>();
        HashMap<DataRecord, Integer> map = new HashMap<DataRecord, Integer>();
        for (int i = 0; i < 100; i++) {
            int size = 100 + i * 10;
            RandomInputStream in = new RandomInputStream(size + offset, size);
            DataRecord rec = ds.addRecord(in);
            list.add(rec);
            map.put(rec, new Integer(size));
        }
        Random random = new Random(1);
        for (int i = 0; i < list.size(); i++) {
            int pos = random.nextInt(list.size());
            DataRecord rec = list.get(pos);
            int size = map.get(rec);
            rec = ds.getRecord(rec.getIdentifier());
            assertEquals(size, rec.getLength());
            InputStream in = rec.getStream();
            RandomInputStream expected = new RandomInputStream(size + offset,
                size);
            if (random.nextBoolean()) {
                in = readInputStreamRandomly(in, random);
            }
            assertEquals(expected, in);
View Full Code Here

Examples of org.apache.jackrabbit.core.data.RandomInputStream

     *      Indexing ignored file types creates some garbage
     */
    public void testEmptyParser() throws Exception {

        InternalValue val = InternalValue
                .create(new RandomInputStream(1, 1024));

        Metadata metadata = new Metadata();
        metadata.set(Metadata.CONTENT_TYPE, "application/java-archive");
        metadata.set(Metadata.CONTENT_ENCODING, "UTF-8");

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.