Package java.io

Examples of java.io.ByteArrayInputStream.reset()


                setEntityInputStream(in);
            }

            ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream) in;
            Form f = getEntity(Form.class);
            byteArrayInputStream.reset();
            return f;
        } else {
            return new Form();
        }
    }
View Full Code Here


            assertEquals("myname", bean.getName());
            assertEquals("myvalue", bean.getValue());
            // Reset buffer
            ByteArrayInputStream bais = (ByteArrayInputStream)in;
            bais.reset();

            request.getProperties().put("filtered", "true");
            return request;
        }
       
View Full Code Here

    long start = System.currentTimeMillis();
    for (int i = 0; i < 10; i++) {
      ByteArrayInputStream is = new ByteArrayInputStream(multiBulkReply);
      for (int j = 0; j < 100000; j++) {
        RedisProtocol.receive(is);
        is.reset();
      }
      long end = System.currentTimeMillis();
      long diff = end - start;
      System.out.println(diff + " " + ((double)diff)/100000);
      start = end;
View Full Code Here

            if (xmlc instanceof Recyclable) {
              ((Recyclable)xmlc).recycle();
            } else {
              xmlc = makeSerializer();
            }
            bis.reset();
            p.parse(bis,wrapper);
        }
        long stop = System.currentTimeMillis();

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

        descript = new GlyfDescript[numGlyphs];
        ByteArrayInputStream bais = new ByteArrayInputStream(buf);
        for (int i = 0; i < numGlyphs; i++) {
            int len = loca.getOffset((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);
                } else {
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

            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) {
                    public Object readUnshared() throws IOException, ClassNotFoundException {
                        return null;
View Full Code Here

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

            in.reset();
            try {
                new ObjectInputStream(in) {
                    public GetField readFields() throws IOException,
                            ClassNotFoundException, NotActiveException {
                        return null;
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.