public void flushChars() throws IOException { cb.flushBuffer(); state = BYTE_STATE; }
public void flushChars() throws IOException { cb.flushBuffer(); state = BYTE_STATE; }
public void writeByte(int b) throws IOException { if (suspended) return; if (state == CHAR_STATE) cb.flushBuffer(); state = BYTE_STATE; bb.append( (byte)b ); bytesWritten++; }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void write(byte b[], int off, int len) throws IOException { if (suspended) return; if (state == CHAR_STATE) cb.flushBuffer(); state = BYTE_STATE; writeBytes(b, off, len); }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void append( char b ) throws IOException { makeSpace( 1 ); // couldn't make space if( limit >0 && end >= limit ) { flushBuffer(); } buff[end++]=b; }
public void write(byte b[], int off, int len) throws IOException { if(suspended) { return; } if(state == CHAR_STATE) { cb.flushBuffer(); } state = BYTE_STATE; writeBytes(b, off, len); }
public void writeByte(int b) throws IOException { if(suspended) { return; } if(state == CHAR_STATE) { cb.flushBuffer(); } state = BYTE_STATE; bb.append((byte) b); bytesWritten++; }
public void append(char b) throws IOException { makeSpace(1); int limit = getLimitInternal(); // couldn't make space if (end >= limit) { flushBuffer(); } buff[end++] = b; }
/** Append a string to the buffer */ public void append(String s, int off, int len) throws IOException { if (s==null) return; // will grow, up to limit makeSpace( len ); // if we don't have limit: makeSpace can grow as it wants if( limit < 0 ) { // assert: makeSpace made enough space s.getChars(off, off+len, buff, end ); end+=len; return; } int sOff = off; int sEnd = off + len; while (sOff < sEnd) { int d = min(limit - end, sEnd - sOff); s.getChars( sOff, sOff+d, buff, end); sOff += d; end += d; if (end >= limit) flushBuffer(); } }
/** Add data to the buffer */ public void append(StringBuilder sb) throws IOException { int len = sb.length(); // will grow, up to limit makeSpace(len); // if we don't have limit: makeSpace can grow as it wants if (limit < 0) { // assert: makeSpace made enough space sb.getChars(0, len, buff, end); end += len; return; } int off = 0; int sbOff = off; int sbEnd = off + len; while (sbOff < sbEnd) { int d = min(limit - end, sbEnd - sbOff); sb.getChars(sbOff, sbOff + d, buff, end); sbOff += d; end += d; if (end >= limit) flushBuffer(); } }
/** Append a string to the buffer */ public void append(String s, int off, int len) throws IOException { if (s==null) return; // will grow, up to limit makeSpace( len ); // if we don't have limit: makeSpace can grow as it wants if( limit < 0 ) { // assert: makeSpace made enough space s.getChars(off, off+len, buff, end ); end+=len; return; } int sOff = off; int sEnd = off + len; while (sOff < sEnd) { int d = min(limit - end, sEnd - sOff); s.getChars( sOff, sOff+d, buff, end); sOff += d; end += d; if (end >= limit) flushBuffer(); } }
/** Add data to the buffer */ public void append( StringBuffer sb ) throws IOException { int len=sb.length(); // will grow, up to limit makeSpace( len ); // if we don't have limit: makeSpace can grow as it wants if( limit < 0 ) { // assert: makeSpace made enough space sb.getChars(0, len, buff, end ); end+=len; return; } int off=0; int sbOff = off; int sbEnd = off + len; while (sbOff < sbEnd) { int d = min(limit - end, sbEnd - sbOff); sb.getChars( sbOff, sbOff+d, buff, end); sbOff += d; end += d; if (end >= limit) flushBuffer(); } }
/** Append a string to the buffer */ public void append(String s, int off, int len) throws IOException { if (s==null) return; // will grow, up to limit makeSpace( len ); // if we don't have limit: makeSpace can grow as it wants if( limit < 0 ) { // assert: makeSpace made enough space s.getChars(off, off+len, buff, end ); end+=len; return; } int sOff = off; int sEnd = off + len; while (sOff < sEnd) { int d = min(limit - end, sEnd - sOff); s.getChars( sOff, sOff+d, buff, end); sOff += d; end += d; if (end >= limit) flushBuffer(); } }