package org.craft.atom.protocol.textline.api;

import java.nio.charset.Charset;

import org.craft.atom.protocol.textline.TextLineDecoder;

/**
 * @author mindwind
 * @version 1.0, Aug 5, 2014
 */
public class TextLineDecoderBuilder {

	
	private String  delimiter        ;
	private Charset charset          ;
	private int     defaultBufferSize;
	private int     maxSize          ;
	
	
	public TextLineDecoderBuilder(Charset charset, String delimiter) {
		this.delimiter = delimiter;
		this.charset   = charset;
	}
	
	
	public TextLineDecoderBuilder defaultBufferSize(int defaultBufferSize) { this.defaultBufferSize = defaultBufferSize; return this; } 
	public TextLineDecoderBuilder maxSize          (int maxSize)           { this.maxSize           = maxSize          ; return this; }
	
	
	public TextLineDecoder build() {
		return new TextLineDecoder(charset, delimiter, defaultBufferSize, maxSize);
	}
	
}

@@ -256,32 +256,59 @@
 elimiter        
+ = %22%5Cn%22                    
 ;%0A%09private Chars
@@ -319,32 +319,59 @@
 harset          
+ = Charset.forName(%22utf-8%22)
 ;%0A%09private int  
@@ -390,16 +390,43 @@
 fferSize
+ = 2048                    
 ;%0A%09priva
@@ -453,16 +453,43 @@
         
+ = defaultBufferSize * 1024
 ;%0A%09%0A%09%0A%09p

fix - init value