public void allocate( int initial, int limit ) { boolean output = true; if( buff==null || buff.length < initial ) { buff=new byte[initial]; } this.limit=limit; start=0; end=0; isSet=true; resetStringCache(); }
@Override public void setStart(int start) { if (end < start) { end = start; } this.start = start; resetStringCache(); }
public void recycleAndReset() { buff = null; charset=null; start=0; end=0; isSet=false; resetStringCache(); }
@Override public void setStart(int start) { if (end < start) { end = start; } this.start = start; resetStringCache(); }
/** Maximum amount of data in this buffer. * * If -1 or not set, the buffer will grow indefinitely. * Can be smaller than the current buffer size ( which will not shrink ). * When the limit is reached, the buffer will be flushed ( if out is set ) * or throw exception. */ public void setLimit(int limit) { this.limit=limit; resetStringCache(); }
@Override public void setStart(int start) { if (end < start) { end = start; } this.start = start; resetStringCache(); }
@Override public void setEnd( int i ) { end=i; resetStringCache(); }
public void allocate( int initial, int limit ) { boolean output = true; if( buff==null || buff.length < initial ) { buff=new byte[initial]; } this.limit=limit; start=0; end=0; isSet=true; resetStringCache(); }
public void trimLeft() { boolean modified = false; while (buff[start] <= 0x20) { modified = true; start++; } if (modified) { resetStringCache(); } }
@Override public void setStart(int start) { if (end < start) { end = start; } this.start = start; resetStringCache(); }
public void allocate( int initial, int limit ) { boolean output = true; if( buff==null || buff.length < initial ) { buff=new byte[initial]; } this.limit=limit; start=0; end=0; isSet=true; resetStringCache(); }
public void trimLeft() { boolean modified = false; while (buff[start] <= 0x20) { modified = true; start++; } if (modified) { resetStringCache(); } }
public void allocate( int initial, int limit ) { boolean output = true; if( buff==null || buff.length < initial ) { buff=new byte[initial]; } this.limit=limit; start=0; end=0; isSet=true; resetStringCache(); }
/** Maximum amount of data in this buffer. * * If -1 or not set, the buffer will grow indefinitely. * Can be smaller than the current buffer size ( which will not shrink ). * When the limit is reached, the buffer will be flushed ( if out is set ) * or throw exception. */ public void setLimit(int limit) { this.limit=limit; resetStringCache(); }
@Override public void setEnd( int i ) { end=i; resetStringCache(); }
public int substract() throws IOException { resetStringCache(); if ((end - start) == 0) { if (in == null) return -1; int n = in.realReadBytes( buff, 0, buff.length ); if (n < 0) return -1; } return (buff[start++] & 0xFF); }
public int substract() throws IOException { resetStringCache(); if ((end - start) == 0) { if (in == null) return -1; int n = in.realReadBytes( buff, 0, buff.length ); if (n < 0) return -1; } return (buff[start++] & 0xFF); }
public int substract() throws IOException { resetStringCache(); if ((end - start) == 0) { if (in == null) return -1; int n = in.realReadBytes( buff, 0, buff.length ); if (n < 0) return -1; } return (buff[start++] & 0xFF); }
public void append( byte b ) throws IOException { resetStringCache(); makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void append( byte b ) throws IOException { resetStringCache(); makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }