mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-21 10:45:59 +10:00
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1428 84d0f5b1-2673-498c-a247-62c4ff18d310
15 lines
432 B
Java
15 lines
432 B
Java
package com.profiler.io;
|
|
|
|
import java.net.DatagramPacket;
|
|
import java.util.Arrays;
|
|
|
|
public class PacketUtils {
|
|
|
|
public static byte[] sliceData(DatagramPacket packet, int startOffset) {
|
|
int packetLength = packet.getLength();
|
|
int packetOffset = packet.getOffset();
|
|
byte[] source = packet.getData();
|
|
return Arrays.copyOfRange(source, packetOffset + startOffset, packetLength);
|
|
}
|
|
}
|