Java Code Examples for org.apache.catalina.tribes.io.XByteBuffer#toBytes()
The following examples show how to use
org.apache.catalina.tribes.io.XByteBuffer#toBytes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestMulticastPackages.java From Tomcat8-Source-Read with MIT License | 6 votes |
public static Data createRandomData(int size, int number) { int i = r.nextInt(); i = ( i % 127 ); int length = Math.abs(r.nextInt() % size); if (length<100) length += 100; Data d = new Data(); d.length = length; d.key = (byte)i; d.data = new byte[length]; Arrays.fill(d.data,d.key); if (number>0 && d.data.length>=4) { //populate number d.hasNr = true; XByteBuffer.toBytes(number,d.data, 0); } return d; }
Example 2
Source File: TestUdpPackages.java From Tomcat8-Source-Read with MIT License | 6 votes |
public static Data createRandomData(int size, int number) { int i = r.nextInt(); i = ( i % 127 ); int length = Math.abs(r.nextInt() % size); if (length<100) length += 100; Data d = new Data(); d.length = length; d.key = (byte)i; d.data = new byte[length]; Arrays.fill(d.data,d.key); if (number>0 && d.data.length>=4) { //populate number d.hasNr = true; XByteBuffer.toBytes(number,d.data, 0); } return d; }
Example 3
Source File: TestMulticastPackages.java From Tomcat7.0.67 with Apache License 2.0 | 6 votes |
public static Data createRandomData(int size, int number) { int i = r.nextInt(); i = ( i % 127 ); int length = Math.abs(r.nextInt() % size); if (length<100) length += 100; Data d = new Data(); d.length = length; d.key = (byte)i; d.data = new byte[length]; Arrays.fill(d.data,d.key); if (number>0 && d.data.length>=4) { //populate number d.hasNr = true; XByteBuffer.toBytes(number,d.data, 0); } return d; }
Example 4
Source File: TestUdpPackages.java From Tomcat7.0.67 with Apache License 2.0 | 6 votes |
public static Data createRandomData(int size, int number) { int i = r.nextInt(); i = ( i % 127 ); int length = Math.abs(r.nextInt() % size); if (length<100) length += 100; Data d = new Data(); d.length = length; d.key = (byte)i; d.data = new byte[length]; Arrays.fill(d.data,d.key); if (number>0 && d.data.length>=4) { //populate number d.hasNr = true; XByteBuffer.toBytes(number,d.data, 0); } return d; }
Example 5
Source File: TestMulticastPackages.java From tomcatsrc with Apache License 2.0 | 6 votes |
public static Data createRandomData(int size, int number) { int i = r.nextInt(); i = ( i % 127 ); int length = Math.abs(r.nextInt() % size); if (length<100) length += 100; Data d = new Data(); d.length = length; d.key = (byte)i; d.data = new byte[length]; Arrays.fill(d.data,d.key); if (number>0 && d.data.length>=4) { //populate number d.hasNr = true; XByteBuffer.toBytes(number,d.data, 0); } return d; }
Example 6
Source File: TestUdpPackages.java From tomcatsrc with Apache License 2.0 | 6 votes |
public static Data createRandomData(int size, int number) { int i = r.nextInt(); i = ( i % 127 ); int length = Math.abs(r.nextInt() % size); if (length<100) length += 100; Data d = new Data(); d.length = length; d.key = (byte)i; d.data = new byte[length]; Arrays.fill(d.data,d.key); if (number>0 && d.data.length>=4) { //populate number d.hasNr = true; XByteBuffer.toBytes(number,d.data, 0); } return d; }