@Test(timeout = 10000)
public void writeWithOffsetUndLength() throws IOException {

    testChannel = new TestPipeChannel(4096);
    PipeChannelOutputStream output = new PipeChannelOutputStream(testChannel, Duration.ofSeconds(2));
    byte[] msgBytes = new byte[]{1, 2, 3};
    output.write(msgBytes, 0, msgBytes.length - 1);
    assertThat(testChannel.getWriteBufferContent()).containsExactly((byte) 1, (byte) 2);
    output.write(msgBytes, 2, msgBytes.length - 2);
    assertThat(testChannel.getWriteBufferContent()).containsExactly((byte) 3);
    output.write(msgBytes, 1, 1);
    assertThat(testChannel.getWriteBufferContent()).containsExactly((byte) 2);
}