public String ReadFile(String filename) throws IOException {

		// Get an input stream from the file.
		FileConnection fc = (FileConnection) Connector.open(filename);
		boolean bFileExists = fc.exists();
		if (bFileExists) {
			filesize = fc.fileSize();
			// System.err.println(filesize);
		}
		if (bFileExists && filesize < 319488) {

			InputStream stream = fc.openInputStream();
			LineReader lineReader = new LineReader(stream);

			// We read data from input stream one line at a time until we
			// reach end of file. Each line is parsed to extract data.
			for (;;) {
				try {
					String line = new String(lineReader.readLine());
					// verify each line
					PinSender ps = new PinSender();
					verifypin = ps.VerifyPin(line);
					if (verifypin == false) {
						// record number of bad pins
						badpins++;
						continue;
					}

					// store the contact pins in an array
					PinScreen.ContactArray.addElement(line);
					// count the number of pins
					countpin++;

				} catch (EOFException eof) {
					// We've reached the end of the file.
					fileResponse = countpin + " contacts selected, " + badpins
							+ " invalid PINS";
					// System.out.println(fileResponse);
					break;
				} catch (IOException ioe) {
					// Error reading data from file
					fileResponse = "An error occured while reading file.";
				}
			}
			PinScreen.info.setText("Contacts selected!");
			if (countpin < 1) {
				PinScreen.FileSel = null;
				PinScreen.info.setText("No Contacts selected!");
				PinScreen.ContactArray.removeAllElements();
			}
			fc.close();
			System.out.println(PinScreen.ContactArray.capacity());
			System.out.println(PinScreen.ContactArray.size());
		} else {
			fileResponse = "Please select a file less than 300KB";
		}

		return fileResponse;

	}