Author: ron.sigal(a)jboss.com
Date: 2008-05-21 23:48:57 -0400 (Wed, 21 May 2008)
New Revision: 4219
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/synchronous/Payload.java
Log:
JBREM-982: readExternal() and writeExternal() use byte arrays.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/synchronous/Payload.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/synchronous/Payload.java 2008-05-22
03:45:41 UTC (rev 4218)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/performance/synchronous/Payload.java 2008-05-22
03:48:57 UTC (rev 4219)
@@ -87,11 +87,11 @@
int size = in.readInt();
byte[] bytes = new byte[size];
- for(int i = 0; i < size; i++)
+ int n = 0;
+ while (n < size)
{
- bytes[i] = in.readByte();
+ n += in.read(bytes, n, size - n);
}
-
this.payload = bytes;
}
@@ -115,10 +115,6 @@
out.writeInt(callNumber);
byte[] bytes = (byte[]) payload;
out.writeInt(bytes.length);
-
- for(int i = 0; i < bytes.length; i++)
- {
- out.writeByte(bytes[i]);
- }
+ out.write(bytes, 0, bytes.length);
}
}
\ No newline at end of file
Show replies by date