Added buffer size control option

Change-Id: I862a186434eb43efc5758b50e4945db54c848683
Signed-off-by: Andrey Shamis <lolnik@gmail.com>