Code example for DataInputStream

Methods: readreadInt

0
	public void setInputStream(InputStream in) {
		stream = new DataInputStream(in);
	} 
	 
	private String getInputData(DataInputStream stream) throws IOException {		
		int size = stream.readInt();
		byte[] data = new byte[size];
		stream.read(data,0,size);
		return new String(data);
	} 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java