Post Reply 
Help With Java
Author Message
roberth
Resident Full Stop Abuser.....

Posts: 4,580.2098
Threads: 200
Joined: 18th Jun 2007
Reputation: -5.5814
E-Pigs: 43.8419
Offline
Post: #1
Help With Java
Spoiler:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import java.io.*;

public class SpeedCam
{
	private static final String FILE_SPEC0 = "C://camera0_test1.dat";
	private static final String FILE_SPEC1 = "C://camera0_test2.dat";
	private static final int SPEED_LIMIT = 50;

	public static void processData()
	{
		FileInputStream fis;
		DataInputStream dis;
		FileOutputStream fos;
		DataOutputStream dos;
		String regNum;
		int Time1;
		int Time2;
		int Time3;
		String VehicleType;
		
		try
		{
			fis = new FileInputStream(FILE_SPEC0);
			dis = new DataInputStream(fis);
			fos = new FileOutputStream(FILE_SPEC1);
			dos = new DataOutputStream(fos);

			while(true)
			{
				try
				{
					regNum = dis.readUTF();
					Time1 = dis.readInt();
					Time2 = dis.readInt();
					Time3 = dis.readInt();
					VehicleType = dis.readUTF();
					System.out.print(regNum+"\t"+Time1+"\t"+Time2+"\t"+Time3+"\t"+VehicleType);
					
				}
				catch(Exception e)
				{
					fis.close();
					fos.close();
				}
			}
		}
		catch(Exception e)
		{
		}
	}

	public static void main(String[] args)
	{
		processData();
	}
}

I don't have even the vaugest idea what's wrong with this, but its flat out refusing to print. The file exists, and supposedly contains relevant information, although i can't confirm this. Does anyone have enough experience to be able to guide me down the right path so i can get started on this application

(This post was last modified: 27/11/2009 08:59 AM by roberth.)
27/11/2009 08:58 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Help With Java - roberth - 27/11/2009 08:58 AM
RE: Help With Java - roberth - 27/11/2009, 09:01 AM
RE: Help With Java - boogschd - 27/11/2009, 09:02 AM
RE: Help With Java - lembas - 27/11/2009, 11:11 AM
RE: Help With Java - roberth - 27/11/2009, 11:23 AM
RE: Help With Java - trademark91 - 27/11/2009, 11:15 AM
RE: Help With Java - LumpiaWarrior - 27/11/2009, 11:18 AM
RE: Help With Java - Hellgiver - 27/11/2009, 02:47 PM
RE: Help With Java - roberth - 03/02/2010, 03:43 AM
RE: Help With Java - ZiNgA BuRgA - 03/02/2010, 03:55 AM

Forum Jump:


User(s) browsing this thread: 3 Guest(s)

 Quick Theme: