Package java.io

Examples of java.io.ByteArrayInputStream.reset()


    }
    assertEquals(dataSet.size(), set.size());
    assertTrue(set.equals(dataSet));
   
    set.clear();
    bais.reset();
    decoder.reInit(bais);
    value = 0;
    while ((value = decoder.decode()) != IntDecoder.EOS) {
      set.add(value);
    }
View Full Code Here


        // parse documents
        long start = System.currentTimeMillis();
        for(int i=0;i<loop;i++) {
            xmlc.recycle();
            bis.reset();
            p.parse(bis,wrapper);
        }
        long stop = System.currentTimeMillis();

        double r = 1000*loop/(stop-start);
 
View Full Code Here

        long loop = 10000;

        long start = System.currentTimeMillis();
        for(int i=0;i<loop;i++) {
            b.recycle();
            bis.reset();
            p.parse(bis,wrapper);
        }
        long stop = System.currentTimeMillis();

        double r = 1000*loop/(stop-start);
 
View Full Code Here

            InputStream in = new ByteArrayInputStream(out.toByteArray());

            // should not cause SecurityException
            new ObjectInputStream(in);
            in.reset();

            // should not cause SecurityException
            new ObjectInputStream(in) {};
            in.reset();
View Full Code Here

            new ObjectInputStream(in);
            in.reset();

            // should not cause SecurityException
            new ObjectInputStream(in) {};
            in.reset();

            try {
                new ObjectInputStream(in) {
                    @Override
                    public Object readUnshared() throws IOException, ClassNotFoundException {
View Full Code Here

                fail("should throw SecurityException 1");
            } catch (SecurityException e) {
                // Expected
            }

            in.reset();
            try {
                new ObjectInputStream(in) {
                    @Override
                    public GetField readFields() throws IOException,
                            ClassNotFoundException, NotActiveException {
View Full Code Here

    for(int idx = 0; idx < numRecords; idx++) {
      records[idx].write(dout);
    }
    times.write = System.nanoTime() - times.write;
   
    bin.reset();
    DataInputStream din = new DataInputStream(bin);
   
    times.readFields = System.nanoTime();
    for(int idx = 0; idx < numRecords; idx++) {
      records[idx].readFields(din);
View Full Code Here

        descript = new GlyfDescript[numGlyphs];
        ByteArrayInputStream bais = new ByteArrayInputStream(buf);
        for (int i = 0; i < numGlyphs; i++) {
            int len = loca.getOffset((short)(i + 1)) - loca.getOffset(i);
            if (len > 0) {
                bais.reset();
                bais.skip(loca.getOffset(i));
                short numberOfContours = (short)(bais.read()<<8 | bais.read());
                if (numberOfContours >= 0) {
                    descript[i] = new GlyfSimpleDescript(this, numberOfContours, bais);
                }
View Full Code Here

        }

        for (int i = 0; i < numGlyphs; i++) {
            int len = loca.getOffset((short)(i + 1)) - loca.getOffset(i);
            if (len > 0) {
                bais.reset();
                bais.skip(loca.getOffset(i));
                short numberOfContours = (short)(bais.read()<<8 | bais.read());
                if (numberOfContours < 0) {
                    descript[i] = new GlyfCompositeDescript(this, bais);
                }
View Full Code Here

             * @see java.io.InputStream#reset()
             */
            @Override
            public synchronized void reset() throws IOException
            {
                proxy.reset();
            }

            /* (non-Javadoc)
             * @see java.io.InputStream#skip(long)
             */
 
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.