@@ -0,0 +1,1024 @@
+package com.genymobile.scrcpy;%0A%0Aimport org.junit.Assert;%0Aimport org.junit.Test;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.DataOutputStream;%0Aimport java.io.IOException;%0Aimport java.nio.charset.StandardCharsets;%0A%0Apublic class DeviceMessageWriterTest %7B%0A%0A    @Test%0A    public void testSerializeClipboard() throws IOException %7B%0A        DeviceMessageWriter writer = new DeviceMessageWriter();%0A%0A        String text = %22a%C3%A9%C3%BBo%C3%A7%22;%0A        byte%5B%5D data = text.getBytes(StandardCharsets.UTF_8);%0A        ByteArrayOutputStream bos = new ByteArrayOutputStream();%0A        DataOutputStream dos = new DataOutputStream(bos);%0A        dos.writeByte(DeviceMessage.TYPE_CLIPBOARD);%0A        dos.writeShort(data.length);%0A        dos.write(data);%0A%0A        byte%5B%5D expected = bos.toByteArray();%0A%0A        DeviceMessage msg = DeviceMessage.createClipboard(text);%0A        bos = new ByteArrayOutputStream();%0A        writer.writeTo(msg, bos);%0A%0A        byte%5B%5D actual = bos.toByteArray();%0A%0A        Assert.assertArrayEquals(expected, actual);%0A    %7D%0A%7D%0A

Add unit test for device message serialization