short size = 1234;
byte[] payload = {12,43, 55,123, 11, 55};
byte [] shortSize = ByteBuffer.allocate(2).putShort(size).array();
byte[] entirePayload = new byte[shortSize.length+payload.length];
System.arraycopy(shortSize, 0, entirePayload, 0, 2);
System.arraycopy(payload, 0, entirePayload, 2, payload.length);
是否有一个根本原因,这是一个Java的系统调用?
仅仅因为函数驻留在System类中并不会使其成为“系统调用”。 'System'只是另一个Java类。 – 2013-02-08 20:35:53