Code example for Scanner

Methods: useDelimiter

0
		this(Constants.TRADE_BOOKING_PORT); 
	} 
	 
	/* package */ TradeBooker(int port) throws IOException {
		mNetAdapter = new NetworkAdapter(port);
		mPriceScanner = new Scanner(mNetAdapter.openStream());
		mPriceScanner.useDelimiter("");
	} 
 
	public float buy() throws IOException { 
		return doAction('B'); 
	} 
	 
	public float sell() throws IOException { 
		return doAction('S'); 
	} 
	 
	// Hacky way to do this because the server doesn't want to send an end character 
	public float doAction(char c) throws IOException {
		mNetAdapter.sendText(c);