Examples of reset()


Examples of java.util.zip.Inflater.reset()

                    int original_size=hdr.original_size;
                    byte[] uncompressed_payload=new byte[original_size];
                    Inflater inflater=null;
                    try {
                        inflater=inflater_pool.take();
                        inflater.reset();
                        inflater.setInput(compressed_payload, msg.getOffset(), msg.getLength());
                        try {
                            inflater.inflate(uncompressed_payload);
                            if(log.isTraceEnabled())
                                log.trace("uncompressed " + compressed_payload.length + " bytes to " + original_size +
View Full Code Here

Examples of java.util.zip.InflaterInputStream.reset()

     */
    public void test_reset() {
        InputStream is = new ByteArrayInputStream(new byte[10]);
        InflaterInputStream iis = new InflaterInputStream(is);
        try {
            iis.reset();
            fail("Should throw IOException");
        } catch (IOException e) {
            // correct
        }
    }
View Full Code Here

Examples of javax.crypto.Mac.reset()

        mac = Mac.getInstance(hmacName, "BC");

        mac.init(key);

        mac.reset();

        mac.update(message, 0, message.length);

        out = mac.doFinal();
View Full Code Here

Examples of javax.imageio.ImageReader.reset()

            do {
                try {
                    ImageInputStream iis = ictx.createImageInputStream();
                    reader.setInput(iis, seekForwardOnly, ignoreMetadata);
                    reader.read(0);
                    reader.reset();
                    iis.close();
                    ictx.closeOriginalStream();
                } catch (IOException e) {
                    e.printStackTrace();
                }
View Full Code Here

Examples of javax.imageio.ImageWriter.reset()

    try {
      src = new BufferedImage(toWidth, toHeight, BufferedImage.TYPE_INT_RGB);
      src.getGraphics().drawImage(ImageIO.read(is), 0, 0, toWidth, toHeight, null);
      out = new ByteArrayOutputStream(imageBytes.length);

      imgWrier.reset();
      imgWrier.setOutput(ImageIO.createImageOutputStream(out));
      imgWrier.write(null, new IIOImage(src, null, null), null);
      imageBytes = out.toByteArray();
      out.flush();
      out.close();
View Full Code Here

Examples of javax.imageio.stream.FileImageInputStream.reset()

                // Checking Magic Number
                fis = new FileImageInputStream(input);
                byte[] b = new byte[4];
                fis.mark();
                fis.readFully(b);
                fis.reset();
                boolean cdfCheck = (b[0] == (byte)0x43 && b[1] == (byte)0x44 && b[2] == (byte)0x46);
                boolean hdf5Check = (b[0] == (byte)0x89 && b[1] == (byte)0x48 && b[2] == (byte)0x44);
                boolean gribCheck = (b[0] == (byte)0x47 && b[1] == (byte)0x52 && b[2] == (byte)0x49 && b[3] == (byte)0x42);

                // Check if the GRIB library is available
View Full Code Here

Examples of javax.imageio.stream.ImageInputStream.reset()

                            throw new ImageException("Unsupported ColorSpace for image "
                                        + info
                                        + ". The number of components supported are 1, 3 and 4.");
                        }
                    } finally {
                        in.reset();
                    }
                    in.skipBytes(reclen);
                    break;
                case APP2: //ICC (see ICC1V42.pdf)
                    in.mark();
View Full Code Here

Examples of javax.imageio.stream.ImageInputStreamImplTest.BasicImageInputStreamImpl.reset()

    out.writeChars("test");
    in.readFully(buff, 0, 4);
    assertEquals("test", new String(buff));

    out.reset();
    in.reset();
    out.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    in.setByteOrder(ByteOrder.LITTLE_ENDIAN);
    out.writeChars("test");
    in.readFully(buff, 0, 4);
    assertEquals("test", new String(buff));
View Full Code Here

Examples of javax.imageio.stream.ImageOutputStream.reset()

            int pos = 0;
            try {
                ios.mark();
                do {
                    if (pos >= length) {
                        ios.reset();
                        ios.mark();
                        pos = 0;
                    }
                    ios.write(0);
                    pos++;
View Full Code Here

Examples of javax.imageio.stream.MemoryCacheImageInputStream.reset()

        i.seek(17);
        h.check(i.getStreamPosition() == 17);
        i.mark();
        i.seek(49);
        h.check(i.getStreamPosition() == 49);
        i.reset();
        h.check(i.getStreamPosition() == 17);

        // Test skipBytes().
        i.setBitOffset(3);
        i.skipBytes(20);
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.