import java.io.PrintWriter;
import java.io.StringWriter;
/*
* SSHTools - Java SSH2 API
*
* Copyright (C) 2002-2003 Lee David Painter and Contributors.
*
* Contributions made by:
*
* Brett Smith
* Richard Pernavas
* Erwin Bolwidt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//package com.sshtools.daemon.util;
/**
* The sole instance of this class provides several convienience methods for
* string manipulation such as substring replacement or character repetition.
*
* @author Manfred Duchrow
* @version 2.0
*/
public class Util{
/**
* Returns an array of strings that contains all strings given by the first
* and second string array. The strings from the second array will be
* added at the end of the first array.
*
* @param strings The array of string to which to append
* @param appendStrings The string to be appended to the first array
*
* @return
*/
public String[] append(String[] strings, String[] appendStrings) {
String[] newStrings = null;
if (strings == null) {
return appendStrings;
}
if (appendStrings == null) {
return strings;
}
newStrings = new String[strings.length + appendStrings.length];
System.arraycopy(strings, 0, newStrings, 0, strings.length);
System.arraycopy(appendStrings, 0, newStrings, strings.length,
appendStrings.length);
return newStrings;
}
}