/** Normalizes the given string. */
protected String normalize(String s) {
- StringBuffer str = new StringBuffer();
+ StringBuilder str = new StringBuilder();
int len = (s != null) ? s.length() : 0;
for ( int i = 0; i < len; i++ ) {
*/
public String toString() {
- StringBuffer sb = new StringBuffer("Extension[");
+ StringBuilder sb = new StringBuilder("Extension[");
sb.append(extensionName);
if (implementationURL != null) {
sb.append(", implementationURL=");
*/
public static String convert(byte bytes[]) {
- StringBuffer sb = new StringBuffer(bytes.length * 2);
+ StringBuilder sb = new StringBuilder(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
sb.append(convertDigit(bytes[i] >> 4));
sb.append(convertDigit(bytes[i] & 0x0f));
public String toString() {
- StringBuffer sb = new StringBuffer("ManifestResource[");
+ StringBuilder sb = new StringBuilder("ManifestResource[");
sb.append(resourceName);
sb.append(", isFulfilled=");
char content[] = new char[message.length()];
message.getChars(0, message.length(), content, 0);
- StringBuffer result = new StringBuffer(content.length + 50);
+ StringBuilder result = new StringBuilder(content.length + 50);
for (int i = 0; i < content.length; i++) {
switch (content[i]) {
case '<':
boolean mark = false;
boolean modifiedCommand = false;
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
for(int i = 0; i < pattern.length(); i++) {
char c = pattern.charAt(i);
* @param oldInside Flag value
* @return True if new is inside buffer
*/
- protected boolean translateCommand( StringBuffer buf, String pattern, int index, boolean oldInside ) {
+ protected boolean translateCommand( StringBuilder buf, String pattern, int index, boolean oldInside ) {
char firstChar = pattern.charAt( index );
boolean newInside = oldInside;
public String encode( String path ) {
int maxBytesPerChar = 10;
- StringBuffer rewrittenPath = new StringBuffer(path.length());
+ StringBuilder rewrittenPath = new StringBuilder(path.length());
ByteArrayOutputStream buf = new ByteArrayOutputStream(maxBytesPerChar);
OutputStreamWriter writer = null;
try {
/**
* Buffer.
*/
- protected StringBuffer buffer = new StringBuffer();
+ protected StringBuilder buffer = new StringBuilder();
/**
throws IOException {
if (writer != null) {
writer.write(buffer.toString());
- buffer = new StringBuffer();
+ buffer = new StringBuilder();
}
}