public final FastStringBuffer append( FastStringBuffer b ) { if( b!=null ) { append( b, 0, b.length() ); } return this; }
public final FastStringBuffer append( FastStringBuffer b ) { if( b!=null ) { append( b, 0, b.length() ); } return this; }
/** * Replace a set of Strings. */ public final void replace( String oldString, String newString ) { int pos = 0; while(pos<length()) { pos = indexOf(oldString,pos); if( pos>=0 ) { replace( pos, pos+oldString.length(), newString ); pos += newString.length(); } else { return; } } }
/** * Replace a set of Strings. */ public final void replace( String oldString, String newString ) { int pos = 0; while(pos<length()) { pos = indexOf(oldString,pos); if( pos>=0 ) { replace( pos, pos+oldString.length(), newString ); pos += newString.length(); } else { return; } } }
public String writeToString() { FastStringBuffer b = new FastStringBuffer(4096); for( Map.Entry<String,String> e: _properties.entrySet() ) { String key = e.getKey(); String value = e.getValue(); if(b.length()>0) { b.append((char)0); } b.append(key); b.append('='); b.append(value); } return b.toString(); }
public String writeToString() { FastStringBuffer b = new FastStringBuffer(4096); for( Map.Entry<String,String> e: _properties.entrySet() ) { String key = e.getKey(); String value = e.getValue(); if(b.length()>0) { b.append((char)0); } b.append(key); b.append('='); b.append(value); } return b.toString(); }
/** * Convert an integer to an Hexa string and pad the result with '0' * @param value the int to convert * @param nChars the number of characters of the result * @return the resulting string * @ibm-api * @throws NumberFormatException if nChars is less that the actual number of characters needed */ public static final String toUnsignedHex( int value, int nChars ) { FastStringBuffer b = new FastStringBuffer(); //String s = Integer.toHexString(value); for( int i=7; i>=0; i-- ) { int v = (value >>> (i*4)) & 0x0F; if( b.length()>0 || v!=0 || i<nChars || i==0 ) { b.append(hexChar(v)); } } if( nChars>0 && b.length()>nChars ) { throw new NumberFormatException( StringUtil.format( "Hexadecimal number {0} too big to fit in '{1}' characters", //$NLS-StringUtil.StringUtil.HexNumTooBig.Exception-1$ StringUtil.toString(value), StringUtil.toString(nChars) )); } return b.toString(); } public static final char hexChar(int v) {
/** * Convert an integer to an Hexa string and pad the result with '0' * @param value the int to convert * @param nChars the number of characters of the result * @return the resulting string * @ibm-api * @throws NumberFormatException if nChars is less that the actual number of characters needed */ public static final String toUnsignedHex( int value, int nChars ) { FastStringBuffer b = new FastStringBuffer(); //String s = Integer.toHexString(value); for( int i=7; i>=0; i-- ) { int v = (value >>> (i*4)) & 0x0F; if( b.length()>0 || v!=0 || i<nChars || i==0 ) { b.append(hexChar(v)); } } if( nChars>0 && b.length()>nChars ) { throw new NumberFormatException( StringUtil.format( "Hexadecimal number {0} too big to fit in '{1}' characters", //$NLS-StringUtil.StringUtil.HexNumTooBig.Exception-1$ StringUtil.toString(value), StringUtil.toString(nChars) )); } return b.toString(); } public static final char hexChar(int v) {