Barcode Reader CLI
Integration
Java
import java io bufferedreader; import java io ioexception; import java io inputstreamreader; import java io file; public class brcli example{ 	 	public static string implode(string separator, string\[] data) { 	 stringbuilder sb = new stringbuilder(); 	 for (int i = 0; i < data length 1; i++) { 	 //data length 1 => to not add separator at the end 	 if (!data\[i] matches(" ")) {//empty string are ""; " "; " "; and so on 	 sb append(data\[i]); 	 sb append(separator); 	 } 	 } 	 sb append(data\[data length 1] trim()); 	 return sb tostring(); 	}	 	 public static void main(string \[]args) throws ioexception { 	 boolean iswindows = system getproperty("os name") tolowercase() startswith("windows"); 	 file mydir = new file(brcli example class getprotectiondomain() getcodesource() getlocation() getpath()); 		 	 string\[] cargs = { 	 (iswindows) ? " \\\barcodereadercli exe" " /barcodereadercli", 	 " type=code128", 	 "https //wabr inliteresearch com/sampleimages/1d pdf", 	 "@ /brcli example config" // additional options and sources in configuration file 	 }; 	 	 	 string cmd = implode(" ", cargs); processbuilder builder = new processbuilder(); 	 if (iswindows) { 	 builder command("cmd exe", "/c", cmd); 	 } else { 	 builder command("sh", " c", cmd); 	 } 	 builder directory(mydir); 	 builder redirecterrorstream(true); 	 process process = builder start(); 	 try (bufferedreader reader = new bufferedreader( 	 new inputstreamreader(process getinputstream()))) { 	 string line; 	 while ((line = reader readline()) != null) { 	 system out println(line); 	 } 	 } } } brcli example config # silent type=code39 \# image from url https //wabr inliteresearch com/sampleimages/1d pdf \# image from local folder /images/test tif