comparison src/samer/units/StreamToDouble.java @ 0:bf79fb79ee13

Initial Mercurial check in.
author samer
date Tue, 17 Jan 2012 17:50:20 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bf79fb79ee13
1 //
2 // StreamToVec.java
3 //
4 //
5 // Created by Samer Abdallah on Mon Jun 10 2002.
6 // Copyright (c) 2002 __MyCompanyName__. All rights reserved.
7 //
8
9 package samer.units;
10
11 import samer.core.*;
12 import samer.core.types.*;
13 import samer.tools.*;
14 import samer.maths.*;
15 import java.io.*;
16
17 public class StreamToDouble extends AnonymousTask {
18 DoubleModel x;
19 InputStream in;
20 DataInputStream objin;
21
22 public StreamToDouble(DoubleModel x, InputStream in) throws Exception
23 {
24 this.x=x;
25 this.in=in;
26 objin=new DataInputStream(in);
27 }
28
29 public void dispose() {
30 try { objin.close(); }
31 catch (Exception ex) {}
32 // close out?
33 }
34 public void run() throws Exception {
35 x.set((double)objin.readFloat());
36 }
37 }