Package java.io

Examples of java.io.ByteArrayInputStream.reset()


        long loop = 10000;

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

        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

      intValue = in.read();
    }
    assertTrue( stringBuffer.toString().indexOf( rootElementName ) != -1 );
    assertTrue( stringBuffer.toString().indexOf( rootElementText ) != -1 );

    inputStream.reset();

    // Read in the XML string using the dom4j api and make sure the decoded xml
    // contains the same strings as the original document.
    document = XmlDom4JHelper.getDocFromStream( inputStream );
    System.out.println( document.asXML() );
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

                    " "+ dashboardPacket.cRioState.analogModule1.input0 +" "
                    +dashboardPacket.cRioState.digitalModule1.pwmValues[4] +" "
                    +dashboardPacket.cRioState.analogModule1.input1);
            try {
                //Thread.sleep(100);
                bytesIn.reset();
            } catch (Exception ex) {
                Logger.getLogger(HostDashboard.class.getName()).log(Level.SEVERE, null, ex);
            }
            //bytesIn.reset();
            i++;
View Full Code Here

                decompress(compressedData, baos);
                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
                Predictor.decodePredictor(predictor, colors, bitsPerPixel, columns, bais, result);
                result.flush();
                baos.reset();
                bais.reset();
            }
            else
            {
                decompress(compressedData, result);
            }
View Full Code Here

            doLZWDecode(compressedData, baos, earlyChange);
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            Predictor.decodePredictor(predictor, colors, bitsPerPixel, columns, bais, result);
            result.flush();
            baos.reset();
            bais.reset();
        }
        else
        {
            doLZWDecode(compressedData, result, earlyChange);
        }
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.