equal
deleted
inserted
replaced
1 /** |
1 /** |
2 * @author cramakrishnan |
2 * @author cramakrishnan |
3 * |
3 * |
4 * Copyright (C) 2003, C. Ramakrishnan / Illposed Software |
4 * Copyright (C) 2003, C. Ramakrishnan / Illposed Software |
5 * All rights reserved. |
5 * All rights reserved. |
6 * |
6 * |
24 |
24 |
25 import com.illposed.osc.utility.*; |
25 import com.illposed.osc.utility.*; |
26 |
26 |
27 public abstract class OSCPacket { |
27 public abstract class OSCPacket { |
28 |
28 |
29 protected byte[] byteArray; |
29 protected byte[] byteArray; |
30 |
30 |
31 public OSCPacket() { |
31 public OSCPacket() { |
32 super(); |
32 super(); |
33 } |
33 } |
34 |
34 |
35 protected void computeByteArray() { |
35 protected void computeByteArray() { |
36 OSCJavaToByteArrayConverter stream = new OSCJavaToByteArrayConverter(); |
36 OSCJavaToByteArrayConverter stream = new OSCJavaToByteArrayConverter(); |
37 computeByteArray(stream); |
37 computeByteArray(stream); |
38 } |
38 } |
39 |
39 |
40 /** |
40 /** |
41 * @param stream OscPacketByteArrayConverter |
41 * @param stream OscPacketByteArrayConverter |
42 * |
42 * |
43 * Subclasses should implement this method to product a byte array |
43 * Subclasses should implement this method to product a byte array |
44 * formatted according to the OSC/SuperCollider specification. |
44 * formatted according to the OSC/SuperCollider specification. |
45 */ |
45 */ |
46 protected abstract void computeByteArray(OSCJavaToByteArrayConverter stream); |
46 protected abstract void computeByteArray(OSCJavaToByteArrayConverter stream); |
47 |
47 |
48 /** |
48 /** |
49 * @return byte[] |
49 * @return byte[] |
50 */ |
50 */ |
51 public byte[] getByteArray() { |
51 public byte[] getByteArray() { |
52 computeByteArray(); |
52 computeByteArray(); |
53 return byteArray; |
53 return byteArray; |
54 } |
54 } |
55 |
55 |
56 protected void init() { |
56 protected void init() { |
57 |
57 |
58 } |
58 } |
59 |
59 |
60 } |
60 } |