@Override
        public Object read(ByteBuffer buffer) {
            int size = buffer.getInt();
            if (size < 0)
                throw new SchemaException("Bytes size " + size + " cannot be negative");
            if (size > buffer.remaining())
                throw new SchemaException("Error reading bytes of size " + size + ", only " + buffer.remaining() + " bytes available");

            int limit = buffer.limit();
            int newPosition = buffer.position() + size;
            buffer.limit(newPosition);
            ByteBuffer val = buffer.slice();
            buffer.limit(limit);
            buffer.position(newPosition);
            return val;
        }
The Boolean type represents a boolean value in a byte by using
the value of 0 to represent false, and 1 to represent true.

If for some reason a value that is not 0 or 1 is read,
then any non-zero value will return true.
clients/src/main/java/org/apache/kafka/common/protocol/types/Type.java