public static int writeFixedWidthByteArray(byte[] bytes, byte[] destination, int offset) { int o = offset; UIO.writeBytes(bytes, destination, o); o += bytes.length; return o; }
public static int writeByteArray(byte[] bytes, byte[] destination, int offset) { int o = offset; if (bytes != null) { UIO.intBytes(bytes.length, destination, o); o += 4; UIO.writeBytes(bytes, destination, o); o += bytes.length; } else { UIO.intBytes(-1, destination, o); o += 4; } return o; }