File: test.java

package info (click to toggle)
entropybroker 2.9-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,700 kB
  • sloc: cpp: 14,387; sh: 934; makefile: 188; java: 148; perl: 12
file content (39 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (5)
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
class test
{
	public static void main(String [] args)
	{
		try
		{

			final int n = 10000;
			EntropybrokerConnector example = new EntropybrokerConnector("mauer");

			byte [] data = example.getData(n);

			System.out.print("Got: ");
			for(int loop=0; loop<n; loop++)
			{
				System.out.print("" + data[loop]);
				if (loop < (n - 1))
					System.out.print(", ");
			}
			System.out.println("");

			example.putData(new String("test").getBytes());
		}
		catch(Exception e)
		{
			System.out.println("Details: " + e.getMessage());
			System.out.println("Stack-trace:");
			for(StackTraceElement ste: e.getStackTrace())
			{
				System.out.println(" " + ste.getClassName() + ", "
						+ ste.getFileName() + ", "
						+ ste.getLineNumber() + ", "
						+ ste.getMethodName() + ", "
						+ (ste.isNativeMethod() ?
							"is native method" : "NOT a native method"));
			}
		}
	}
}