sebb 2003/10/02 12:18:42
Modified: src/core/org/apache/jmeter/samplers SampleResult.java
Log:
Replaced convenience method responseDataToString with responseDataAsBA
Revision Changes Path
1.11 +10 -6
jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java
Index: SampleResult.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- SampleResult.java 2 Oct 2003 16:18:21 -0000 1.10
+++ SampleResult.java 2 Oct 2003 19:18:42 -0000 1.11
@@ -90,6 +90,9 @@
*/
public final static String BINARY = "bin";
+ /* empty array which can be returned instead of null */
+ private static final byte [] EMPTY_BA = new byte [0];
+
private byte[] responseData;
private String responseCode;
private String label;
@@ -256,14 +259,15 @@
}
/**
- * Convenience method to return responseData as a String
+ * Convenience method to get responseData as a non-null byte array
+ *
+ * @return the responseData. If responseData is null
+ * then an empty byte array is returned rather than null.
*
- * @return the responseData as a string. If responseData is null
- * then the empty string is returned, rather than null.
*/
- public String responseDatatoString()
+ public byte [] responseDataAsBA()
{
- return (responseData == null) ? "" : new String(responseData);
+ return responseData == null ? EMPTY_BA : responseData;
}
public void setSamplerData(String s)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]