| 3 | import java.io.ByteArrayOutputStream; |
| 4 | |
| 5 | public class DynamicByteArray extends ByteArrayOutputStream |
| 6 | { |
| 7 | public DynamicByteArray() |
| 8 | { |
| 9 | super(); |
| 10 | } |
| 11 | |
| 12 | public DynamicByteArray(int size) |
| 13 | { |
| 14 | super(size); |
| 15 | } |
| 16 | |
| 17 | public int readBackUByte(int off) |
| 18 | { |
| 19 | return buf[count - off] & 0xFF; |
| 20 | } |
| 21 | |
| 22 | public int readUByte(int off) |
| 23 | { |
| 24 | return buf[off] & 0xFF; |
| 25 | } |
| 26 | |
| 27 | public void write(int off, int value) |
| 28 | { |
| 29 | buf[off] = (byte) value; |
| 30 | } |
| 31 | |
| 32 | public void writeCheck(int value, byte[] verif) |
| 33 | { |
| 34 | if ((verif != null) && (value != (verif[count] & 0xFF))) |
| 35 | System.out.println("Error at " + count); |
| 36 | |
| 37 | super.write(value); |
| 38 | } |
| 39 | } |
nothing calls this directly
no outgoing calls
no test coverage detected