if (removeTrailing && !buffer.isEmpty()) buffer.remove(buffer.size() - 1);
	private static byte[] streamToByteArray(InputStream stream, boolean removeTrailing)		throws IOException {		//read byte-by-byte and put it in a vector.		//then take the vector and fill a byteArray.		Vector buffer = new Vector(1024);		int tempByte;		while ((tempByte = stream.read()) != -1) {			buffer.add(new Byte((byte) tempByte));		}		// This assumes that \n is only one byte (it is 2 on windows)		if (removeTrailing && !buffer.isEmpty())			buffer.remove(buffer.size() - 1);		byte[] byteArray = new byte[buffer.size()];		for (int i = 0; i < byteArray.length; i++) {			Byte b = (Byte) buffer.get(i);			byteArray[i] = b.byteValue();		}		return byteArray;	}