Examples of reset()


Examples of java.awt.geom.GeneralPath.reset()

            graphics.draw( subPath );
        }
        subPaths.clear();
        GeneralPath path = drawer.getLinePath();
        graphics.draw( path );
        path.reset();
    }
}
View Full Code Here

Examples of java.awt.geom.Path2D.reset()

        theDirection.scalarMult(arrowLength);
        perp.scalarMult(arrowWidth);

        // Create a polygon.

        shape.reset();
        shape.moveTo(x, y);
        shape.lineTo(x - theDirection.data[0] + perp.data[0], y
            - theDirection.data[1] + perp.data[1]);
        shape.lineTo(x - theDirection.data[0] - perp.data[0], y
            - theDirection.data[1] - perp.data[1]);
View Full Code Here

Examples of java.io.BufferedInputStream.reset()

    }

    /*
     * Try with gunziped stream, second
     */
    b.reset(); // Rewind
    if (formatType(Channels.newChannel(new GZIPInputStream(b))) != null) {
      b.close();

      /*
       * Now reopen the same file, but this time without the buffered
View Full Code Here

Examples of java.io.BufferedReader.reset()

              rd.mark(read_idx++);
              if(rd.read(cbuf)==-1)
                break;
              if(cbuf[0]!='<')
                continue;
              rd.reset();
              break;
            }while(true);
            return (Channel)parser.parse(rd);
          }
          else{
View Full Code Here

Examples of java.io.ByteArrayInputStream.reset()

    final ByteArrayInputStream stream = new ByteArrayInputStream(data);
    if (isGIF(stream))
    {
      return "image/gif";
    }
    stream.reset();
    if (isJPEG(stream))
    {
      return "image/jpeg";
    }
    stream.reset();
View Full Code Here

Examples of java.io.ByteArrayOutputStream.reset()

      encoder.encode(s, 0, s.length(), baos);
      baos.flush();
      byte[] b1 = baos.toByteArray();

      //
      baos.reset();
      OutputStreamWriter osw = new OutputStreamWriter(baos);
      osw.write(s);
      osw.close();
      byte[] b2 = baos.toByteArray();
View Full Code Here

Examples of java.io.CharArrayReader.reset()

                CharArrayReader car = copy(reader);
                XmlEncodingSniffer xes = new XmlEncodingSniffer(car, null);
                Writer out = new OutputStreamWriter(new FileOutputStream(targetFile), xes.getXmlEncoding());
                IOUtil.copyCompletely(car, out);

                car.reset();
                return car;
            }
            catch (IOException e)
            {
                System.err.println("IO Error " + e);
View Full Code Here

Examples of java.io.CharArrayWriter.reset()

        if (Character.isLetter(ch)) {
      ch -= caseDiff;
        }
        out.append(ch);
    }
    charArrayWriter.reset();
    needToChange = true;
      }
  }

  return (needToChange? out.toString() : s);
View Full Code Here

Examples of java.io.DataInputStream.reset()

        byte[] data1 = new byte[sourceData1.length];
        byte[] data2 = new byte[sourceData2.length];
        in.readFully(data1);
        in.mark(sourceData2.length);
        in.readFully(data2);
        in.reset();
        in.readFully(data2);
        assertTrue(Arrays.equals(sourceData1, data1));
        assertTrue(Arrays.equals(sourceData2, data2));
    }
   
View Full Code Here

Examples of java.io.FileInputStream.reset()

            } else if (fileName.endsWith(".bz2")) {
                InputStream is = new FileInputStream(file);
                is.mark(4);
                if (!(is.read() == 'B' && is.read() == 'Z')) {
                    // No BZ prefix as appended by command line tools.  Reset and hope for the best
                    is.reset();
                }
                return new CBZip2InputStream(is);
            }
        } catch (IOException e) {
            logger.warn("Something that looked like a compressed file gave an error on open: "+file,e);
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.