public static BinaryTag readTag(final @NotNull ByteBuf buf) {
        final byte id = buf.readByte();
        if (id >= BINARY_TAG_TYPES.length) {
            throw new DecoderException("Invalid binary tag id: " + id);
        }
        final BinaryTagType<? extends BinaryTag> type = BINARY_TAG_TYPES[id];
        try {
            return type.read(new ByteBufInputStream(buf));
        } catch (final IOException e) {
            throw new DecoderException(e);
        }
    }
@Test
    void testReadMalformedTag() {
        this.buf.writeByte(BinaryTagTypes.STRING.id());
        assertThrows(DecoderException.class, () -> BufUtil.readTag(this.buf));
    }