@Test
    public void array() throws IOException {
        AbstractByteBuf byteBuf = new ByteStreamWrapperByteBuf(null);
        Assert.assertNull(byteBuf.array());
        Assert.assertTrue(byteBuf.readableBytes() == 0);

        UnsafeByteArrayOutputStream bs = new UnsafeByteArrayOutputStream();
        bs.write(new byte[] { 1, 2, 3 });
        byteBuf = new ByteStreamWrapperByteBuf(bs);
        Assert.assertNotNull(byteBuf.array());
        Assert.assertTrue(byteBuf.array().length == 3);
        Assert.assertTrue(byteBuf.readableBytes() == 3);
        Assert.assertTrue(byteBuf.release());
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/api/src/test/java/com/alipay/sofa/rpc/transport/ByteStreamWrapperByteBufTest.java