int length = ObjectOutputStreamMicro.writeMessage(baos, oid, key, qos, content);
assertEquals("wrong length returned", oid.length() + key.length() + qos.length() + content.length + 3, length);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
ObjectInputStreamMicro oism = new ObjectInputStreamMicro(bais);
int size = bais.available();
assertEquals("wrong length of bytes available", length, size);
byte[] msg = new byte[size];
bais.read(msg);
MsgHolder msgHolder = ObjectInputStreamMicro.readMessage(msg);