Package net.charabia.util.io

Examples of net.charabia.util.io.BinaryInputStream.mark()


  InputStream istream = new FileInputStream(f);
        BufferedInputStream buffin = new BufferedInputStream(istream);
  BinaryInputStream in = new BinaryInputStream(buffin);

  try {
      in.mark(1024 * 1024);

      IconDir dir = new IconDir(in);
      //      System.out.println("DIR = " + dir);

      IconEntry[] entries = new IconEntry[dir.idCount];
View Full Code Here


        in.reset();

        boolean pngIcon = false;
        if (entries[i].dwBytesInRes > PNG_SIGNATURE.length) {
          //     Check if this is a PNG icon (introduced in Windows Vista)
          in.mark(1024 * 1024);
          in.skip(entries[i].dwImageOffset);
          byte[] signatureBuffer = new byte[PNG_SIGNATURE.length];
          in.read(signatureBuffer, 0, PNG_SIGNATURE.length);
          pngIcon = Arrays.equals(PNG_SIGNATURE, signatureBuffer);
          in.reset();
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.