if(endFLag == null){
throw new RuntimeException("endFLag cannot be null");
}
if(unitBufferSize < 1){
throw new RuntimeException("unitBufferSize Must be greater than 1");
}