Results 1 to 3 of 3

Thread: [RESOLVED]HELP!!BitSet set() returns null...

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2006
    Posts
    21

    Resolved [RESOLVED]HELP!!BitSet set() returns null...

    Does anyone knows why my fingerprint2 is null when I print it out? Here is my code:
    Code:
     try
    {
            FileInputStream input = new FileInputStream ("fp.bin");
            DataInputStream binData = new DataInputStream (input);
    	
            BitSet fingerprint2 = new BitSet[3]; //my fp.bin file only consists of 2 binaries
            for(int i=0;i<3;i++)
            {
    		for(int j=0;j<1024;j++)
    		{
    			boolean bit = binData.readBoolean();
    			fingerprint2[i].set(j,bit); //something wrong here?
    		}
    		System.out.println(fingerprint2[i]); //throw NullPointerException
    	}
    	binData.close();
    	input.close();
    }
    catch(EOFException eof)
    {
    	
    }
    catch(NullPointerException npe)
    {
    	System.out.println("Null Pointer");
    }
    catch (FileNotFoundException fe)
    {
    	System.out.println("No such file.");
    }
    catch (IOException ie)
    {
    	System.out.println(ie.toString());
    }
    Last edited by huiling25; Jan 19th, 2007 at 02:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width