private static void encryptChar( FastStringBuffer b, int offset, char c ) { int xor = ENCRYPTION[offset%ENCRYPTION.length]; int val = ((int)c) ^ xor; char c1 = (char)((val&0x00F0)/16+(int)'A'); char c2 = (char)((val&0x000F)+(int)'A'); b.append(c1); b.append(c2); } private static char decryptChar( String pwd, int offset, int pos ) {
public final FastStringBuffer prt( String fmt, Object p1, Object p2, Object p3, Object p4, Object p5 ) { // if( prtIndent!=null ) { // append( prtIndent ); // } appendFormat( fmt, p1, p2, p3, p4, p5 ); append( '\n' ); return this; } public final FastStringBuffer prt( String fmt, Object p1, Object p2, Object p3, Object p4 ) {
/** * Append a repeated character. * @param toRepeat the character to repeat * @param count the number of repetition */ public final void repeat( char toRepeat, int count ) { for( int i=0; i<count; i++ ) { append(toRepeat); } }
public final FastStringBuffer prt( String fmt, Object p1, Object p2, Object p3, Object p4, Object p5 ) { // if( prtIndent!=null ) { // append( prtIndent ); // } appendFormat( fmt, p1, p2, p3, p4, p5 ); append( '\n' ); return this; } public final FastStringBuffer prt( String fmt, Object p1, Object p2, Object p3, Object p4 ) {
/** * Append a repeated character string. * @param toRepeat the string to repeat * @param count the number of repetition */ public final void repeat( String toRepeat, int count ) { for( int i=0; i<count; i++ ) { append(toRepeat); } }
/** * Append a repeated character string. * @param toRepeat the string to repeat * @param count the number of repetition */ public final void repeat( String toRepeat, int count ) { for( int i=0; i<count; i++ ) { append(toRepeat); } }
private static void encryptChar( FastStringBuffer b, int offset, char c ) { int xor = ENCRYPTION[offset%ENCRYPTION.length]; int val = ((int)c) ^ xor; char c1 = (char)((val&0x00F0)/16+(int)'A'); char c2 = (char)((val&0x000F)+(int)'A'); b.append(c1); b.append(c2); } private static char decryptChar( String pwd, int offset, int pos ) {
/** * Append a repeated character. * @param toRepeat the character to repeat * @param count the number of repetition */ public final void repeat( char toRepeat, int count ) { for( int i=0; i<count; i++ ) { append(toRepeat); } }
/** * Constructs a string buffer so that it represents the same * sequence of characters as the string argument. The initial * capacity of the string buffer is <code>DELTA</code> plus the length * of the string argument. * @param str the initial contents of the buffer. */ public FastStringBuffer(String str) { this(str.length() + DELTA); append(str); }
/** * Constructs a string buffer so that it represents the same * sequence of characters as the string argument. The initial * capacity of the string buffer is <code>DELTA</code> plus the length * of the string argument. * @param str the initial contents of the buffer. */ public FastStringBuffer(String str) { this(str.length() + DELTA); append(str); }
public final FastStringBuffer append( FastStringBuffer b ) { if( b!=null ) { append( b, 0, b.length() ); } return this; }
/** * Load the content of a IO reader. */ public final FastStringBuffer load( Reader r ) { clear(); return append(r); }
/** * Converts a byte array to a hexadecimal String equivalent. */ public static String toHexValue(byte[] barr) { FastStringBuffer sb = new FastStringBuffer(barr.length*2); for(int i=0; i<barr.length; i++) { int unsigned = barr[i] & 0xFF; sb.append(getUpperDigitAsHex(unsigned)); sb.append(getLowerDigitAsHex(unsigned)); } return sb.toString(); }
/** * Converts a byte array to a hexadecimal String equivalent. */ public static String toHexValue(byte[] barr) { FastStringBuffer sb = new FastStringBuffer(barr.length*2); for(int i=0; i<barr.length; i++) { int unsigned = barr[i] & 0xFF; sb.append(getUpperDigitAsHex(unsigned)); sb.append(getLowerDigitAsHex(unsigned)); } return sb.toString(); }
private void prtHeader() throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '|' ); b.append( pad(table.getColumnTitle(i), sz) ); } b.append( '|' ); println( b.toString() ); } private void prtRow( IRow row ) throws Exception {
private void prtHeader() throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '|' ); b.append( pad(table.getColumnTitle(i), sz) ); } b.append( '|' ); println( b.toString() ); } private void prtRow( IRow row ) throws Exception {
private void prtRow( IRow row ) throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '|' ); b.append( pad(colString(row,i), sz) ); } b.append( '|' ); println( b.toString() ); } private String colString( IRow row, int col ) throws Exception {
private void prtSeparator() throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '+' ); b.repeat( '-', sz ); } b.append( '+' ); println( b.toString() ); } private void prtHeader() throws Exception {
private void prtSeparator() throws Exception { FastStringBuffer b = new FastStringBuffer(); int colCount = table.getColumnCount(); for( int i=0; i<colCount; i++ ) { int sz = Math.min(table.getColumnSize(i),getMaxColSize()); b.append( '+' ); b.repeat( '-', sz ); } b.append( '+' ); println( b.toString() ); } private void prtHeader() throws Exception {