Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

data input stream using while loop

try(DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(new File("text.dat")))))
		{
        	//reading in integers from the file.
			int number;
			while(dis.available() >0)
			{
				number = dis.readInt();
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
 
PREVIOUS NEXT
Tagged: #data #input #stream #loop
ADD COMMENT
Topic
Name
8+1 =