Code example for ByteArrayBuffer

Methods: toByteArray

0
	private AsyncPostRequest connPost = null;
 
	@Override 
	public void onSuccess(ByteArrayBuffer baf) {
		try { 
			Log.d("URLHelper", EncodingUtils.getString(baf.toByteArray(), "utf8"));
			JSONObject obj = new JSONObject(EncodingUtils.getString(baf.toByteArray(), "utf8"));
			mDelegate.updateModelWithJSONObject(obj, this.serviceId);
		} 
		catch (Exception e) {
			e.printStackTrace();
			mDelegate.connectionFailed(this.serviceId);
		} 
	} 
 
	@Override 
	public void onFail() { 
		mDelegate.connectionFailed(this.serviceId);
	}